pub struct TypeDefinition {
pub export_keyword: Option<Token>,
pub type_keyword: Token,
pub type_name: Token,
pub generics: Option<Pointer<GenericDeclaration>>,
pub equal_sign: Token,
pub type_value: Pointer<TypeValue>,
}Expand description
A struct for a type definition. Holds needed data to be able to write it back as valid luau.
Fields§
§export_keyword: Option<Token>The export keyword.
type_keyword: TokenThe type keyword.
type_name: TokenThe name of the type.
generics: Option<Pointer<GenericDeclaration>>The generics for this type.
equal_sign: TokenThe = sign between the name and the actual value of the type.
This will be None if this isn’t it’s own statement but rather
in another place like parameter’s type or a variable’s type.
type_value: Pointer<TypeValue>The actual value of the type.
Trait Implementations§
Source§impl Clone for TypeDefinition
impl Clone for TypeDefinition
Source§fn clone(&self) -> TypeDefinition
fn clone(&self) -> TypeDefinition
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 TypeDefinition
impl Debug for TypeDefinition
Source§impl GetRange for TypeDefinition
impl GetRange for TypeDefinition
Source§impl Hash for TypeDefinition
impl Hash for TypeDefinition
Source§impl Ord for TypeDefinition
impl Ord for TypeDefinition
Source§fn cmp(&self, other: &TypeDefinition) -> Ordering
fn cmp(&self, other: &TypeDefinition) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl Parse for TypeDefinition
impl Parse for TypeDefinition
Source§impl PartialEq for TypeDefinition
impl PartialEq for TypeDefinition
Source§impl PartialOrd for TypeDefinition
impl PartialOrd for TypeDefinition
Source§impl Print for TypeDefinition
impl Print for TypeDefinition
Source§fn print_final_trivia(&self) -> String
fn print_final_trivia(&self) -> String
Prints only the very final trivia. Used for the default implementation of
Print::print, which just joins Print::print_without_final_trivia
and this function.Source§fn print_without_final_trivia(&self) -> String
fn print_without_final_trivia(&self) -> String
Prints the whole token including all surrounding trivia, excluding the
very last trailing trivia.
Source§impl TryParse for TypeDefinition
impl TryParse for TypeDefinition
impl Eq for TypeDefinition
impl StructuralPartialEq for TypeDefinition
Auto Trait Implementations§
impl Freeze for TypeDefinition
impl RefUnwindSafe for TypeDefinition
impl !Send for TypeDefinition
impl !Sync for TypeDefinition
impl Unpin for TypeDefinition
impl UnwindSafe for TypeDefinition
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