[][src]Enum gf::datamodel::Ty

pub enum Ty<'a> {
    Bytes,
    Struct(StructTy<'a>),
}

Type.

Variants

Bytes

Unstructured raw bytes.

Struct(StructTy<'a>)

Structured data.

Methods

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

pub fn arg(&self, id: TyArgId) -> &TyArg[src]

Return type argument by ID.

Errors

  • Panics on invalid ID.

pub fn args(&self) -> &[TyArg][src]

Return type arguments.

pub fn enumerate_args(&self) -> impl Iterator<Item = (TyArgId, &TyArg)>[src]

Return iterator over pairs of IDs and arguments.

pub fn relation(&self, id: RelationId) -> &Relation<'a>[src]

Return relation by ID.

Errors

  • Panics on invalid ID.

pub fn relations(&self) -> &[Relation<'a>][src]

Return relations, or an empty slice for unstructured data.

pub fn enumerate_relations(
    &self
) -> impl Iterator<Item = (RelationId, &Relation<'a>)>
[src]

Return iterator over pairs of IDs and relations.

pub fn is_bytes(&self) -> bool[src]

Return whether this is the raw bytes type.

pub fn parse_order(&self) -> Option<Vec<RelationId>>[src]

Return a parse order induced by dependencies between relations or None if there is a cyclic dependency.

Auto Trait Implementations

impl<'a> Send for Ty<'a>

impl<'a> Sync for Ty<'a>

impl<'a> Unpin for Ty<'a>

impl<'a> UnwindSafe for Ty<'a>

impl<'a> RefUnwindSafe for Ty<'a>

Blanket Implementations

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

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

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]