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,
}
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 TypeLayoutGraph<'_>
impl TypeLayoutGraph<'_>
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
.
Sourcepub const fn hash(&self, seed: u64) -> u64
pub const fn hash(&self, seed: u64) -> u64
Hash this TypeLayoutGraph
using the provided hasher
.
The hash is produced over the serialised form of this
TypeLayoutGraph
, as computed by Self::serialise
.
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>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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: Deref<Target = [Field<'a>]>, V: Deref<Target = [Variant<'a, F>]>, I: Deref<Target = TypeLayoutInfo<'a, F, V>>, G> Deserialize<'de> for TypeLayoutGraph<'a, F, V, I, G>
impl<'de: 'a, 'a, F: Deref<Target = [Field<'a>]>, V: Deref<Target = [Variant<'a, F>]>, I: Deref<Target = TypeLayoutInfo<'a, F, V>>, G> Deserialize<'de> for TypeLayoutGraph<'a, F, V, I, G>
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>,
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,
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
self
and other
values to be equal, and is used by ==
.