Struct grammers_tl_parser::tl::Definition
source · pub struct Definition {
pub namespace: Vec<String>,
pub name: String,
pub id: u32,
pub params: Vec<Parameter>,
pub ty: Type,
pub category: Category,
}
Expand description
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.
Implementations§
Trait Implementations§
source§impl Debug for Definition
impl Debug for Definition
source§impl Display for Definition
impl Display for Definition
source§impl FromStr for Definition
impl FromStr for Definition
source§fn from_str(definition: &str) -> Result<Self, Self::Err>
fn from_str(definition: &str) -> Result<Self, Self::Err>
Parses a Type Language definition.
Examples
use grammers_tl_parser::tl::Definition;
assert!("sendMessage chat_id:int message:string = Message".parse::<Definition>().is_ok());
§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
source§impl PartialEq for Definition
impl PartialEq for Definition
source§fn eq(&self, other: &Definition) -> bool
fn eq(&self, other: &Definition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Definition
Auto Trait Implementations§
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnwindSafe for Definition
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more