#[repr(transparent)]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
sourceimpl LegacyCType for c_char
impl LegacyCType for c_char
sourcefn 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
sourcefn 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 [
CType::c_var
], by bringing a Formatter
in scope. Read moresourcefn c_define_self(_: &mut dyn Definer) -> Result<()>
fn c_define_self(_: &mut dyn Definer) -> Result<()>
sourcefn 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
sourcefn c_short_name() -> ImplDisplay<Self>
fn c_short_name() -> ImplDisplay<Self>
sourcefn legacy_csharp_marshaler() -> Option<String>
fn legacy_csharp_marshaler() -> Option<String>
Optional marshaler attached to the type (e.g.,
[MarshalAs(UnmanagedType.FunctionPtr)]
) Read moresourcefn csharp_var(var_name: &str) -> String
fn csharp_var(var_name: &str) -> String
Convenience function for formatting
{ty} {var}
in CSharp.sourceimpl Ord for c_char
impl Ord for c_char
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<c_char> for c_char
impl PartialOrd<c_char> for c_char
sourcefn partial_cmp(&self, other: &c_char) -> Option<Ordering>
fn partial_cmp(&self, other: &c_char) -> Option<Ordering>
1.0.0 · sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<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
sourcefn csharp_marshaler() -> Option<String>
fn csharp_marshaler() -> Option<String>
Optional marshaler attached to the type (e.g.,
[MarshalAs(UnmanagedType.FunctionPtr)]
) Read morefn zeroed() -> Self
sourceimpl<T> CompatExt for T
impl<T> CompatExt for T
sourceimpl<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
sourceimpl<T> FitForCBox for T
impl<T> FitForCBox for T
type CBoxWrapped = Box_<T>
type CBoxWrapped = Box_<T>
Available on crate feature
alloc
only.sourceimpl<T> ManuallyDropMut for T
impl<T> ManuallyDropMut for T
type Ret = ManuallyDrop<T>
fn manually_drop_mut(&'__ mut self) -> &'__ mut ManuallyDrop<T>
sourceimpl<T> UpcastAny for Twhere
T: 'static,
impl<T> UpcastAny for Twhere
T: 'static,
sourcefn upcast_any(&self) -> &(dyn Any + 'static)
fn upcast_any(&self) -> &(dyn Any + 'static)
Available on crate feature
headers
only.