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 single TL definition — either a constructor or a function.
For example:
user#12345 id:long first_name:string = User;becomes a Definition with name = "user", id = 0x12345,
params = [id:long, first_name:string] and ty = User.
Fields§
§namespace: Vec<String>Namespace parts. Empty when the definition is in the global namespace.
name: StringThe constructor/method name (e.g. "user", "messages.sendMessage").
id: u3232-bit constructor ID, either parsed from #XXXXXXXX or CRC32-derived.
params: Vec<Parameter>Ordered list of parameters.
ty: TypeThe boxed type this definition belongs to (e.g. User).
category: CategoryWhether this is a data constructor or an RPC function.
Implementations§
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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§impl PartialEq for Definition
impl PartialEq for Definition
impl StructuralPartialEq for Definition
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin 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