pub struct Struct {
pub name: Ident,
pub fields: Vec<Field>,
pub origin: Origin<ItemStruct>,
/* private fields */
}Expand description
A #[prebindgen] struct: a product of fields that cross the boundary.
A struct whose contents do not cross is an Extern, not a Struct with
nothing in it — so fields is a plain list, and empty means the source wrote
a struct with no fields.
Whether the fields are named or positional is not recorded: a Field
already knows its own address, and the delimiters are spelling, read off the
syntax when the struct is spelled.
Fields§
§name: Ident§fields: Vec<Field>§origin: Origin<ItemStruct>Implementations§
Source§impl Struct
impl Struct
Sourcepub fn type_ref(&self) -> &TypeRef
pub fn type_ref(&self) -> &TypeRef
This struct as a type reference — what the declaration answers when something needs a reading naming it.
The alternative is composing one from the name at the call site, which
an adapter cannot do (minting is sealed to this crate) and which would
be phase-dependent if routed through the registry instead: a
decomposition is declared before anything is interned. The declaration
is the one thing that can always say. Same reasoning as
Variant::type_ref.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Struct
impl !Sync for Struct
impl Freeze for Struct
impl RefUnwindSafe for Struct
impl Unpin for Struct
impl UnsafeUnpin for Struct
impl UnwindSafe for Struct
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more