pub struct c_int(pub c_int);
Expand description
A ReprC
standalone type with the same layout and ABI as
::libc::c_int
.
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, int32_t
, ⚠️).
By using this type, you guarantee that the C int
type be used in the headers.
Tuple Fields§
§0: c_int
Trait Implementations§
source§impl LegacyCType for c_int
impl LegacyCType for c_int
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 ...
)source§fn legacy_csharp_marshaler() -> Option<String>
fn legacy_csharp_marshaler() -> Option<String>
Optional marshaler attached to the type (e.g.,
[MarshalAs(UnmanagedType.FunctionPtr)]
)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 csharp_var(var_name: &str) -> String
fn csharp_var(var_name: &str) -> String
Convenience function for formatting
{ty} {var}
in CSharp.source§impl PartialEq<c_int> for c_int
impl PartialEq<c_int> for c_int
impl Copy for c_int
impl Eq for c_int
impl StructuralEq for c_int
impl StructuralPartialEq for c_int
Auto Trait Implementations§
impl RefUnwindSafe for c_int
impl Send for c_int
impl Sync for c_int
impl Unpin for c_int
impl UnwindSafe for c_int
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> FitForCBox for T
impl<T> FitForCBox for T
§type CBoxWrapped = Box_<T>
type CBoxWrapped = Box_<T>
Available on crate feature
alloc
only.