[][src]Struct scale_info::TypeDefComposite

pub struct TypeDefComposite<T: Form = MetaForm> { /* fields omitted */ }

A composite type, consisting of either named (struct) or unnamed (tuple struct) fields

Examples

A Rust struct with named fields.

struct Person {
    name: String,
    age_in_years: u8,
    friends: Vec<Person>,
}

A tuple struct with unnamed fields.

struct Color(u8, u8, u8);

A so-called unit struct

struct JustAMarker;

Implementations

impl TypeDefComposite[src]

pub fn new<I>(fields: I) -> Self where
    I: IntoIterator<Item = Field>, 
[src]

Creates a new struct definition with named fields.

impl<T> TypeDefComposite<T> where
    T: Form
[src]

pub fn fields(&self) -> &[Field<T>]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Returns the fields of the composite type.

Trait Implementations

impl<T: Clone + Form> Clone for TypeDefComposite<T>[src]

impl<T: Debug + Form> Debug for TypeDefComposite<T>[src]

impl<T: Form> Decode for TypeDefComposite<T> where
    Vec<Field<T>>: Decode,
    Vec<Field<T>>: Decode
[src]

impl<T: Form> Encode for TypeDefComposite<T> where
    Vec<Field<T>>: Encode,
    Vec<Field<T>>: Encode
[src]

impl<T: Form> EncodeLike<TypeDefComposite<T>> for TypeDefComposite<T> where
    Vec<Field<T>>: Encode,
    Vec<Field<T>>: Encode
[src]

impl<T: Eq + Form> Eq for TypeDefComposite<T>[src]

impl<T: Form> From<TypeDefComposite<T>> for TypeDef<T>[src]

impl<T: Form> From<Vec<Field<T>, Global>> for TypeDefComposite<T>[src]

impl IntoPortable for TypeDefComposite[src]

type Output = TypeDefComposite<PortableForm>

The portable version of Self.

impl<T: Ord + Form> Ord for TypeDefComposite<T>[src]

impl<T: PartialEq + Form> PartialEq<TypeDefComposite<T>> for TypeDefComposite<T>[src]

impl<T: PartialOrd + Form> PartialOrd<TypeDefComposite<T>> for TypeDefComposite<T>[src]

impl<T: Form> StructuralEq for TypeDefComposite<T>[src]

impl<T: Form> StructuralPartialEq for TypeDefComposite<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for TypeDefComposite<T> where
    <T as Form>::String: RefUnwindSafe,
    <T as Form>::Type: RefUnwindSafe
[src]

impl<T> Send for TypeDefComposite<T> where
    <T as Form>::String: Send,
    <T as Form>::Type: Send
[src]

impl<T> Sync for TypeDefComposite<T> where
    <T as Form>::String: Sync,
    <T as Form>::Type: Sync
[src]

impl<T> Unpin for TypeDefComposite<T> where
    <T as Form>::String: Unpin,
    <T as Form>::Type: Unpin
[src]

impl<T> UnwindSafe for TypeDefComposite<T> where
    <T as Form>::String: UnwindSafe,
    <T as Form>::Type: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

impl<T> From<T> for T[src]

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.