Struct ezno_parser::statements::classes::ClassDeclaration
source · pub struct ClassDeclaration<T: ExpressionOrStatementPosition> {
pub class_keyword: Keyword<Class>,
pub name: T::Name,
pub type_parameters: Option<Vec<GenericTypeConstraint>>,
pub extends: Option<TypeReference>,
pub members: Vec<Decorated<ClassMember>>,
pub type_id: TypeId,
pub variable_id: VariableId,
pub position: Span,
}
Fields§
§class_keyword: Keyword<Class>
§name: T::Name
§type_parameters: Option<Vec<GenericTypeConstraint>>
§extends: Option<TypeReference>
TODO shouldn’t be type reference
members: Vec<Decorated<ClassMember>>
§type_id: TypeId
The TypeId is the type of the instance the class defines
variable_id: VariableId
The VariableId is for SomeClass.constructor
and possible static properties etc
position: Span
Implementations§
source§impl<U: ExpressionOrStatementPosition> ClassDeclaration<U>
impl<U: ExpressionOrStatementPosition> ClassDeclaration<U>
pub fn get_variable_id(&self) -> VariableId
Trait Implementations§
source§impl<U: ExpressionOrStatementPosition + Debug + PartialEq + Eq + Clone + 'static> ASTNode for ClassDeclaration<U>
impl<U: ExpressionOrStatementPosition + Debug + PartialEq + Eq + Clone + 'static> ASTNode for ClassDeclaration<U>
fn from_reader( reader: &mut impl TokenReader<TSXToken, Span>, state: &mut ParsingState, settings: &ParseSettings ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, settings: &ToStringSettingsAndData, depth: u8 )
source§fn get_position(&self) -> Cow<'_, Span>
fn get_position(&self) -> Cow<'_, Span>
Returns position of node as span AS IT WAS PARSED. May be none if AST was doesn’t match anything in source
source§fn from_string(
source: String,
settings: ParseSettings,
source_id: SourceId,
offset: Option<usize>,
cursors: Vec<(usize, EmptyCursorId)>
) -> ParseResult<ParseOutput<Self>>
fn from_string( source: String, settings: ParseSettings, source_id: SourceId, offset: Option<usize>, cursors: Vec<(usize, EmptyCursorId)> ) -> ParseResult<ParseOutput<Self>>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, settings: &ToStringSettingsAndData) -> String
fn to_string(&self, settings: &ToStringSettingsAndData) -> String
Returns structure as valid string
source§impl<T: Clone + ExpressionOrStatementPosition> Clone for ClassDeclaration<T>where
T::Name: Clone,
impl<T: Clone + ExpressionOrStatementPosition> Clone for ClassDeclaration<T>where T::Name: Clone,
source§fn clone(&self) -> ClassDeclaration<T>
fn clone(&self) -> ClassDeclaration<T>
Returns a copy 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<T: Debug + ExpressionOrStatementPosition> Debug for ClassDeclaration<T>where
T::Name: Debug,
impl<T: Debug + ExpressionOrStatementPosition> Debug for ClassDeclaration<T>where T::Name: Debug,
source§impl<T: PartialEq + ExpressionOrStatementPosition> PartialEq<ClassDeclaration<T>> for ClassDeclaration<T>where
T::Name: PartialEq,
impl<T: PartialEq + ExpressionOrStatementPosition> PartialEq<ClassDeclaration<T>> for ClassDeclaration<T>where T::Name: PartialEq,
source§fn eq(&self, other: &ClassDeclaration<T>) -> bool
fn eq(&self, other: &ClassDeclaration<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: ExpressionOrStatementPosition> SelfRustTokenize for ClassDeclaration<T>
impl<T: ExpressionOrStatementPosition> SelfRustTokenize for ClassDeclaration<T>
fn append_to_token_stream(&self, _token_stream: &mut TokenStream)
source§fn to_tokens(&self) -> TokenStream
fn to_tokens(&self) -> TokenStream
Returns the tokens used to construct self