Struct const_type_layout::TypeLayoutGraph
source · pub struct TypeLayoutGraph<'a, F: Deref<Target = [Field<'a>]> = &'a [Field<'a>], V: Deref<Target = [Variant<'a, F>]> = &'a [Variant<'a, F>], I: Deref<Target = TypeLayoutInfo<'a, F, V>> = &'a TypeLayoutInfo<'a, F, V>, G: Deref<Target = [I]> = &'a [I]> {
pub ty: &'a str,
pub tys: G,
}
Available on crate feature
derive
only.Expand description
Description of the deep layout of a type.
Fields§
§ty: &'a str
The type’s fully-qualified name.
tys: G
The list of types that make up the complete graph describing the deep layout of this type.
Implementations§
source§impl TypeLayoutGraph<'static>
impl TypeLayoutGraph<'static>
sourcepub const fn new<T: TypeLayout + ComputeTypeSet>() -> Self
pub const fn new<T: TypeLayout + ComputeTypeSet>() -> Self
Construct the deep type layout descriptor for a type T
.
source§impl<'a> TypeLayoutGraph<'a>
impl<'a> TypeLayoutGraph<'a>
sourcepub const fn serialised_len(&self) -> usize
pub const fn serialised_len(&self) -> usize
Compute the number of bytes that this TypeLayoutGraph
serialises
into.
sourcepub const fn serialise(&self, bytes: &mut [u8])
pub const fn serialise(&self, bytes: &mut [u8])
Serialise this TypeLayoutGraph
into the mutable byte slice.
bytes
must have a length of at least Self::serialised_len
.
Use serialise_type_graph
instead to serialise the
TypeLayoutGraph
of a type T
into a byte array of the
appropriate length.
Panics
This method panics iff bytes
has a length of less than
Self::serialised_len
.
Trait Implementations§
source§impl<'a, F: Clone + Deref<Target = [Field<'a>]>, V: Clone + Deref<Target = [Variant<'a, F>]>, I: Clone + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Clone + Deref<Target = [I]>> Clone for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Clone + Deref<Target = [Field<'a>]>, V: Clone + Deref<Target = [Variant<'a, F>]>, I: Clone + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Clone + Deref<Target = [I]>> Clone for TypeLayoutGraph<'a, F, V, I, G>
source§fn clone(&self) -> TypeLayoutGraph<'a, F, V, I, G>
fn clone(&self) -> TypeLayoutGraph<'a, F, V, I, G>
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<'a, F: Deref<Target = [Field<'a>]> + Debug, V: Deref<Target = [Variant<'a, F>]> + Debug, I: Deref<Target = TypeLayoutInfo<'a, F, V>> + Debug, G: Deref<Target = [I]> + Debug> Debug for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Deref<Target = [Field<'a>]> + Debug, V: Deref<Target = [Variant<'a, F>]> + Debug, I: Deref<Target = TypeLayoutInfo<'a, F, V>> + Debug, G: Deref<Target = [I]> + Debug> Debug for TypeLayoutGraph<'a, F, V, I, G>
source§impl<'de: 'a, 'a, F, V, I, G> Deserialize<'de> for TypeLayoutGraph<'a, F, V, I, G>where
F: Deserialize<'a> + Deref<Target = [Field<'a>]>,
V: Deserialize<'a> + Deref<Target = [Variant<'a, F>]>,
I: Deserialize<'a> + Deref<Target = TypeLayoutInfo<'a, F, V>>,
G: Deserialize<'a> + Deref<Target = [I]>,
'a: 'de,
impl<'de: 'a, 'a, F, V, I, G> Deserialize<'de> for TypeLayoutGraph<'a, F, V, I, G>where
F: Deserialize<'a> + Deref<Target = [Field<'a>]>,
V: Deserialize<'a> + Deref<Target = [Variant<'a, F>]>,
I: Deserialize<'a> + Deref<Target = TypeLayoutInfo<'a, F, V>>,
G: Deserialize<'a> + Deref<Target = [I]>,
'a: 'de,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a, F: Hash + Deref<Target = [Field<'a>]>, V: Hash + Deref<Target = [Variant<'a, F>]>, I: Hash + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Hash + Deref<Target = [I]>> Hash for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Hash + Deref<Target = [Field<'a>]>, V: Hash + Deref<Target = [Variant<'a, F>]>, I: Hash + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Hash + Deref<Target = [I]>> Hash for TypeLayoutGraph<'a, F, V, I, G>
source§impl<'a, F: Ord + Deref<Target = [Field<'a>]>, V: Ord + Deref<Target = [Variant<'a, F>]>, I: Ord + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Ord + Deref<Target = [I]>> Ord for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Ord + Deref<Target = [Field<'a>]>, V: Ord + Deref<Target = [Variant<'a, F>]>, I: Ord + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Ord + Deref<Target = [I]>> Ord for TypeLayoutGraph<'a, F, V, I, G>
source§fn cmp(&self, other: &TypeLayoutGraph<'a, F, V, I, G>) -> Ordering
fn cmp(&self, other: &TypeLayoutGraph<'a, F, V, I, G>) -> 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<'a, F: PartialEq + Deref<Target = [Field<'a>]>, V: PartialEq + Deref<Target = [Variant<'a, F>]>, I: PartialEq + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: PartialEq + Deref<Target = [I]>> PartialEq for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: PartialEq + Deref<Target = [Field<'a>]>, V: PartialEq + Deref<Target = [Variant<'a, F>]>, I: PartialEq + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: PartialEq + Deref<Target = [I]>> PartialEq for TypeLayoutGraph<'a, F, V, I, G>
source§fn eq(&self, other: &TypeLayoutGraph<'a, F, V, I, G>) -> bool
fn eq(&self, other: &TypeLayoutGraph<'a, F, V, I, G>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a, F: PartialOrd + Deref<Target = [Field<'a>]>, V: PartialOrd + Deref<Target = [Variant<'a, F>]>, I: PartialOrd + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: PartialOrd + Deref<Target = [I]>> PartialOrd for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: PartialOrd + Deref<Target = [Field<'a>]>, V: PartialOrd + Deref<Target = [Variant<'a, F>]>, I: PartialOrd + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: PartialOrd + Deref<Target = [I]>> PartialOrd for TypeLayoutGraph<'a, F, V, I, G>
source§fn partial_cmp(
&self,
other: &TypeLayoutGraph<'a, F, V, I, G>
) -> Option<Ordering>
fn partial_cmp( &self, other: &TypeLayoutGraph<'a, F, V, I, G> ) -> 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 moresource§impl<'a, F, V, I, G> Serialize for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F, V, I, G> Serialize for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Eq + Deref<Target = [Field<'a>]>, V: Eq + Deref<Target = [Variant<'a, F>]>, I: Eq + Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Eq + Deref<Target = [I]>> Eq for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Deref<Target = [Field<'a>]>, V: Deref<Target = [Variant<'a, F>]>, I: Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Deref<Target = [I]>> StructuralEq for TypeLayoutGraph<'a, F, V, I, G>
impl<'a, F: Deref<Target = [Field<'a>]>, V: Deref<Target = [Variant<'a, F>]>, I: Deref<Target = TypeLayoutInfo<'a, F, V>>, G: Deref<Target = [I]>> StructuralPartialEq for TypeLayoutGraph<'a, F, V, I, G>
Auto Trait Implementations§
impl<'a, F, V, I, G> RefUnwindSafe for TypeLayoutGraph<'a, F, V, I, G>where
G: RefUnwindSafe,
impl<'a, F, V, I, G> Send for TypeLayoutGraph<'a, F, V, I, G>where
G: Send,
impl<'a, F, V, I, G> Sync for TypeLayoutGraph<'a, F, V, I, G>where
G: Sync,
impl<'a, F, V, I, G> Unpin for TypeLayoutGraph<'a, F, V, I, G>where
G: Unpin,
impl<'a, F, V, I, G> UnwindSafe for TypeLayoutGraph<'a, F, V, I, G>where
G: UnwindSafe,
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> ExtractDiscriminant for T
impl<T> ExtractDiscriminant for T
§type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty
type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty
The type of the discriminant, which must satisfy the trait bounds
required by
core::mem::Discriminant
. Read more