pub struct Type {
pub namespace: Vec<String>,
pub name: String,
pub bare: bool,
pub generic_ref: bool,
pub generic_arg: Option<Box<Type>>,
}Expand description
The type of a definition or a parameter, e.g. ns.Vector<!X>.
Fields§
§namespace: Vec<String>Namespace components, e.g. ["upload"] for upload.File.
name: StringThe bare type name, e.g. "Vector".
bare: booltrue when the first letter of the name is lowercase (bare type).
generic_ref: booltrue when this type is a generic parameter reference (prefixed with !).
generic_arg: Option<Box<Type>>The generic argument, e.g. long in Vector<long>.
Trait Implementations§
Source§impl FromStr for Type
impl FromStr for Type
Source§fn from_str(raw: &str) -> Result<Self, Self::Err>
fn from_str(raw: &str) -> Result<Self, Self::Err>
Parses a TL type expression such as ns.Vector<!X>.
§Examples
use layer_tl_parser::tl::Type;
assert!("Vector<long>".parse::<Type>().is_ok());
assert!("!X".parse::<Type>().is_ok());Source§type Err = ParamParseError
type Err = ParamParseError
The associated error which can be returned from parsing.
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
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