[][src]Struct gf::datamodel::TyInstance

pub struct TyInstance<'a> { /* fields omitted */ }

Type instance, i.e. a type with fixed argument values.

Methods

impl<'a> TyInstance<'a>[src]

pub fn new<I>(ty: &'a Ty<'a>, arg_values: I) -> Result<Self, TyError> where
    I: IntoIterator<Item = TyArgValue<'a>>, 
[src]

Create a type instance.

pub fn new_bytes<T: Into<u64>>(bytes: T, endianness: Endianness) -> Self[src]

Create an instance of the raw type for given number of bytes.

pub unsafe fn new_unchecked<I>(ty: &'a Ty<'a>, arg_values: I) -> Self where
    I: IntoIterator<Item = TyArgValue<'a>>, 
[src]

Create a type instance without type-checking arguments.

pub fn ty(&self) -> &'a Ty<'a>[src]

Return type.

pub fn arg_value(&self, id: TyArgId) -> &TyArgValue<'a>[src]

Return type argument value by ID.

Errors

  • Panics on invalid ID.

pub fn arg_values(&self) -> &[TyArgValue<'a>][src]

Return type argument values.

pub fn into_arg_values(self) -> impl Iterator<Item = TyArgValue<'a>>[src]

Consume the instance and return an iterator over the argument values.

pub fn bytes(&self) -> u64[src]

Return number of bytes in a raw type instance.

Errors

  • Panics if self is not an instance of the raw bytes type.

pub fn bytes_endianness(&self) -> Endianness[src]

Return endianness of a raw type instance.

Errors

  • Panics if self is not an instance of the raw bytes type.

Trait Implementations

impl<'a> Clone for TyInstance<'a>[src]

Auto Trait Implementations

impl<'a> Send for TyInstance<'a>

impl<'a> Sync for TyInstance<'a>

impl<'a> Unpin for TyInstance<'a>

impl<'a> UnwindSafe for TyInstance<'a>

impl<'a> RefUnwindSafe for TyInstance<'a>

Blanket Implementations

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

impl<T> From<T> for T[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.

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

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

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