Struct grammers_tl_parser::tl::Definition[][src]

pub struct Definition {
    pub namespace: Vec<String>,
    pub name: String,
    pub id: u32,
    pub params: Vec<Parameter>,
    pub ty: Type,
    pub category: Category,
}

A Type Language definition.

Fields

namespace: Vec<String>

The namespace components of the definition. This list will be empty if the name of the definition belongs to the global namespace.

name: String

The name of this definition. Also known as “predicate” or “method”.

id: u32

The numeric identifier of this definition.

If a definition has an identifier, it overrides this value. Otherwise, the identifier is inferred from the definition.

params: Vec<Parameter>

A possibly-empty list of parameters this definition has.

ty: Type

The type to which this definition belongs to.

category: Category

The category to which this definition belongs to.

Trait Implementations

impl Debug for Definition[src]

impl Display for Definition[src]

impl FromStr for Definition[src]

type Err = ParseError

The associated error which can be returned from parsing.

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

Parses a Type Language definition.

Examples

use grammers_tl_parser::tl::Definition;

assert!("sendMessage chat_id:int message:string = Message".parse::<Definition>().is_ok());

impl PartialEq<Definition> for Definition[src]

impl StructuralPartialEq for Definition[src]

Auto Trait Implementations

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.