Struct interoptopus::lang::c::CompositeType
source · pub struct CompositeType { /* private fields */ }
Expand description
Used for Rust and C struct
with named fields, must be #[repr(C)]
.
Might translate to a struct or class in another language, equivalent on C-level to:
ⓘ
typedef struct MyComposite
{
int field_1;
float field_2;
char field_3;
// ...
} MyComposite;
Implementations§
source§impl CompositeType
impl CompositeType
sourcepub fn new(name: String, fields: Vec<Field>) -> Self
pub fn new(name: String, fields: Vec<Field>) -> Self
Creates a new composite with the given name and fields and no documentation.
sourcepub fn with_meta(name: String, fields: Vec<Field>, meta: Meta) -> Self
pub fn with_meta(name: String, fields: Vec<Field>, meta: Meta) -> Self
Creates a new composite with the given name and type-level documentation.
pub fn fields(&self) -> &[Field]
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True if this struct has no contained fields (which happens to be illegal in C99).
pub fn meta(&self) -> &Meta
Trait Implementations§
source§impl Clone for CompositeType
impl Clone for CompositeType
source§fn clone(&self) -> CompositeType
fn clone(&self) -> CompositeType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CompositeType
impl Debug for CompositeType
source§impl Hash for CompositeType
impl Hash for CompositeType
source§impl Ord for CompositeType
impl Ord for CompositeType
source§fn cmp(&self, other: &CompositeType) -> Ordering
fn cmp(&self, other: &CompositeType) -> Ordering
1.21.0 · source§fn 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
source§impl PartialEq for CompositeType
impl PartialEq for CompositeType
source§fn eq(&self, other: &CompositeType) -> bool
fn eq(&self, other: &CompositeType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CompositeType
impl PartialOrd for CompositeType
source§fn partial_cmp(&self, other: &CompositeType) -> Option<Ordering>
fn partial_cmp(&self, other: &CompositeType) -> Option<Ordering>
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 Eq for CompositeType
impl StructuralPartialEq for CompositeType
Auto Trait Implementations§
impl RefUnwindSafe for CompositeType
impl Send for CompositeType
impl Sync for CompositeType
impl Unpin for CompositeType
impl UnwindSafe for CompositeType
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