Struct grammers_tl_parser::tl::Type[][src]

pub struct Type {
    pub namespace: Vec<String>,
    pub name: String,
    pub bare: bool,
    pub generic_ref: bool,
    pub generic_arg: Option<Box<Type>>,
}

The type of a definition or a parameter.

Fields

namespace: Vec<String>

The namespace components of the type.

name: String

The name of the type.

bare: bool

Whether this type is bare or boxed.

generic_ref: bool

Whether the type name refers to a generic definition.

generic_arg: Option<Box<Type>>

If the type has a generic argument, which is its type.

Trait Implementations

impl Debug for Type[src]

impl Display for Type[src]

impl FromStr for Type[src]

type Err = ParamParseError

The associated error which can be returned from parsing.

fn from_str(ty: &str) -> Result<Self, Self::Err>[src]

Parses a type.

Examples

use grammers_tl_parser::tl::Type;

assert!("vector<int>".parse::<Type>().is_ok());

impl PartialEq<Type> for Type[src]

impl StructuralPartialEq for Type[src]

Auto Trait Implementations

impl RefUnwindSafe for Type

impl Send for Type

impl Sync for Type

impl Unpin for Type

impl UnwindSafe for Type

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<T> From<T> for T[src]

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

impl<T> ToString for T where
    T: Display + ?Sized
[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.