pub enum TypeLayout {
Primitive(PrimitiveLayout),
Std(StdLayout),
Struct(StructLayout),
Enum(EnumLayout),
CEnum(CEnumLayout),
Alias(UnresolvedType),
Other {
name: String,
},
}
Variants§
Primitive(PrimitiveLayout)
Language-specific primitive types from core::primitive
(e.g. i32
, f64
, etc.)
There are all simple types that can be backed by a single slice of memory and easily transumted to a Rust type
Std(StdLayout)
Common definitions from the Rust standard library
Struct(StructLayout)
Structs and tuples
Enum(EnumLayout)
Enums
CEnum(CEnumLayout)
C-style enumerations (simple named integer constants)
Alias(UnresolvedType)
Reference to some other type
We use this when we’re traversing a type definition and want to lazily evaluate nested types.
Other
Other types not yet supported/handled
Implementations§
Source§impl TypeLayout
impl TypeLayout
pub fn display_name(&self) -> String
pub fn size(&self) -> Option<usize>
pub fn matching_type(&self, other: &TypeLayout) -> bool
pub fn as_reference(&self) -> TypeLayout
pub fn dereferenced(&self) -> &TypeLayout
Trait Implementations§
Source§impl Clone for TypeLayout
impl Clone for TypeLayout
Source§fn clone(&self) -> TypeLayout
fn clone(&self) -> TypeLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TypeLayout
impl Debug for TypeLayout
Source§impl From<EnumLayout> for TypeLayout
impl From<EnumLayout> for TypeLayout
Source§fn from(enum_def: EnumLayout) -> TypeLayout
fn from(enum_def: EnumLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<FloatLayout> for TypeLayout
impl From<FloatLayout> for TypeLayout
Source§fn from(float: FloatLayout) -> TypeLayout
fn from(float: FloatLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<IntLayout> for TypeLayout
impl From<IntLayout> for TypeLayout
Source§fn from(int: IntLayout) -> TypeLayout
fn from(int: IntLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<MapLayout> for TypeLayout
impl From<MapLayout> for TypeLayout
Source§fn from(map: MapLayout) -> TypeLayout
fn from(map: MapLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<PrimitiveLayout> for TypeLayout
impl From<PrimitiveLayout> for TypeLayout
Source§fn from(primitive: PrimitiveLayout) -> TypeLayout
fn from(primitive: PrimitiveLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<ReferenceLayout> for TypeLayout
impl From<ReferenceLayout> for TypeLayout
Source§fn from(reference: ReferenceLayout) -> TypeLayout
fn from(reference: ReferenceLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<SmartPtrLayout> for TypeLayout
impl From<SmartPtrLayout> for TypeLayout
Source§fn from(smart_ptr: SmartPtrLayout) -> TypeLayout
fn from(smart_ptr: SmartPtrLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<StdLayout> for TypeLayout
impl From<StdLayout> for TypeLayout
Source§fn from(std_def: StdLayout) -> TypeLayout
fn from(std_def: StdLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<StringLayout> for TypeLayout
impl From<StringLayout> for TypeLayout
Source§fn from(string: StringLayout) -> TypeLayout
fn from(string: StringLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<StructLayout> for TypeLayout
impl From<StructLayout> for TypeLayout
Source§fn from(struct_def: StructLayout) -> TypeLayout
fn from(struct_def: StructLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<UnresolvedType> for TypeLayout
impl From<UnresolvedType> for TypeLayout
Source§fn from(type_ref: UnresolvedType) -> TypeLayout
fn from(type_ref: UnresolvedType) -> TypeLayout
Converts to this type from the input type.
Source§impl From<UnsignedIntLayout> for TypeLayout
impl From<UnsignedIntLayout> for TypeLayout
Source§fn from(uint: UnsignedIntLayout) -> TypeLayout
fn from(uint: UnsignedIntLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl From<VecLayout> for TypeLayout
impl From<VecLayout> for TypeLayout
Source§fn from(vec: VecLayout) -> TypeLayout
fn from(vec: VecLayout) -> TypeLayout
Converts to this type from the input type.
Source§impl Hash for TypeLayout
impl Hash for TypeLayout
Source§impl PartialEq for TypeLayout
impl PartialEq for TypeLayout
Source§impl Update for TypeLayout
impl Update for TypeLayout
Source§unsafe fn maybe_update(
old_pointer_: *mut TypeLayout,
new_value_: TypeLayout,
) -> bool
unsafe fn maybe_update( old_pointer_: *mut TypeLayout, new_value_: TypeLayout, ) -> bool
Returns Read more
impl Eq for TypeLayout
impl StructuralPartialEq for TypeLayout
Auto Trait Implementations§
impl Freeze for TypeLayout
impl RefUnwindSafe for TypeLayout
impl Send for TypeLayout
impl Sync for TypeLayout
impl Unpin for TypeLayout
impl UnwindSafe for TypeLayout
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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