pub struct c_char(pub u8);
Expand description
A ReprC
standalone type with the same layout and ABI as
::libc::c_char
.
By standalone, the idea is that this is defined as a (transparent
) newtype struct
,
rather than as a type
alias, which is error-prone and yields less-portable headers (since
the header generation will resolve the type alias and emit, for instance, int8_t
, ⚠️).
By using this type, you guarantee that the C char
type be used in the headers.
Tuple Fields§
§0: u8
Trait Implementations§
source§impl LegacyCType for c_char
impl LegacyCType for c_char
source§fn c_short_name_fmt(fmt: &mut Formatter<'_>) -> Result
fn c_short_name_fmt(fmt: &mut Formatter<'_>) -> Result
A short-name description of the type, mainly used to fill
“placeholders” such as when monomorphising generics structs or
arrays. Read more
source§fn c_var_fmt(fmt: &mut Formatter<'_>, var_name: &str) -> Result
fn c_var_fmt(fmt: &mut Formatter<'_>, var_name: &str) -> Result
The core method of the trait: it provides the implementation to be
used by
LegacyCType::c_var
, by bringing a Formatter
in scope. Read moresource§fn csharp_define_self(_: &mut dyn Definer) -> Result<()>
fn csharp_define_self(_: &mut dyn Definer) -> Result<()>
Extra typedef code (e.g.
[LayoutKind.Sequential] struct ...
)type OPAQUE_KIND = Concrete
source§fn c_short_name() -> ImplDisplay<Self>
fn c_short_name() -> ImplDisplay<Self>
source§fn c_var(var_name: &str) -> ImplDisplay<'_, Self>
fn c_var(var_name: &str) -> ImplDisplay<'_, Self>
Convenience function for callers / users of types implementing
LegacyCType
. Read moresource§fn legacy_csharp_marshaler() -> Option<String>
fn legacy_csharp_marshaler() -> Option<String>
Optional marshaler attached to the type (e.g.,
[MarshalAs(UnmanagedType.FunctionPtr)]
)source§fn csharp_var(var_name: &str) -> String
fn csharp_var(var_name: &str) -> String
Convenience function for formatting
{ty} {var}
in CSharp.source§impl Ord for c_char
impl Ord for c_char
source§impl PartialEq<c_char> for c_char
impl PartialEq<c_char> for c_char
source§impl PartialOrd<c_char> for c_char
impl PartialOrd<c_char> for c_char
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for c_char
impl Eq for c_char
impl StructuralEq for c_char
impl StructuralPartialEq for c_char
Auto Trait Implementations§
impl RefUnwindSafe for c_char
impl Send for c_char
impl Sync for c_char
impl Unpin for c_char
impl UnwindSafe for c_char
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CType for Twhere
T: LegacyCType,
impl<T> CType for Twhere T: LegacyCType,
type OPAQUE_KIND = <T as LegacyCType>::OPAQUE_KIND
fn short_name() -> String
fn define_self__impl( _: &(dyn HeaderLanguage + 'static), _: &mut dyn Definer ) -> Result<(), Error>
fn define_self( language: &(dyn HeaderLanguage + 'static), definer: &mut dyn Definer ) -> Result<(), Error>
fn name(language: &(dyn HeaderLanguage + 'static)) -> String
fn name_wrapping_var( language: &(dyn HeaderLanguage + 'static), var_name: &str ) -> String
source§fn csharp_marshaler() -> Option<String>
fn csharp_marshaler() -> Option<String>
Optional marshaler attached to the type (e.g.,
[MarshalAs(UnmanagedType.FunctionPtr)]
)fn zeroed() -> Self
source§impl<T> ConcreteReprC for Twhere
<T as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>,
T: ReprC + ?Sized,
impl<T> ConcreteReprC for Twhere <T as ReprC>::CLayout: CType<OPAQUE_KIND = Concrete>, T: ReprC + ?Sized,
type ConcreteCLayout = <T as ReprC>::CLayout
source§impl<T> FitForCBox for T
impl<T> FitForCBox for T
§type CBoxWrapped = Box_<T>
type CBoxWrapped = Box_<T>
Available on crate feature
alloc
only.source§impl<T> ManuallyDropMut for T
impl<T> ManuallyDropMut for T
type Ret = ManuallyDrop<T>
fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>
source§impl<T> UpcastAny for Twhere
T: 'static,
impl<T> UpcastAny for Twhere T: 'static,
source§fn upcast_any(&self) -> &(dyn Any + 'static)
fn upcast_any(&self) -> &(dyn Any + 'static)
Available on crate feature
headers
only.