pub struct Class { /* private fields */ }
Expand description
Implementations§
source§impl Class
impl Class
sourcepub fn new(
name: Option<Identifier>,
super_ref: Option<Expression>,
constructor: Option<Function>,
elements: Box<[ClassElement]>,
has_binding_identifier: bool
) -> Self
pub fn new( name: Option<Identifier>, super_ref: Option<Expression>, constructor: Option<Function>, elements: Box<[ClassElement]>, has_binding_identifier: bool ) -> Self
Creates a new class declaration.
sourcepub const fn name(&self) -> Option<Identifier>
pub const fn name(&self) -> Option<Identifier>
Returns the name of the class.
sourcepub const fn super_ref(&self) -> Option<&Expression>
pub const fn super_ref(&self) -> Option<&Expression>
Returns the super class ref of the class.
sourcepub const fn constructor(&self) -> Option<&Function>
pub const fn constructor(&self) -> Option<&Function>
Returns the constructor of the class.
sourcepub const fn elements(&self) -> &[ClassElement]
pub const fn elements(&self) -> &[ClassElement]
Gets the list of all fields defined on the class.
sourcepub const fn has_binding_identifier(&self) -> bool
pub const fn has_binding_identifier(&self) -> bool
Returns whether the class has a binding identifier.
Trait Implementations§
source§impl<'a> From<&'a mut Class> for NodeRefMut<'a>
impl<'a> From<&'a mut Class> for NodeRefMut<'a>
source§fn from(node: &'a mut Class) -> NodeRefMut<'a>
fn from(node: &'a mut Class) -> NodeRefMut<'a>
Converts to this type from the input type.
source§impl From<Class> for Declaration
impl From<Class> for Declaration
source§impl From<Class> for Expression
impl From<Class> for Expression
source§impl PartialEq for Class
impl PartialEq for Class
source§impl ToIndentedString for Class
impl ToIndentedString for Class
source§impl VisitWith for Class
impl VisitWith for Class
source§fn visit_with<'a, V>(&'a self, visitor: &mut V) -> ControlFlow<V::BreakTy>where
V: Visitor<'a>,
fn visit_with<'a, V>(&'a self, visitor: &mut V) -> ControlFlow<V::BreakTy>where
V: Visitor<'a>,
Visit this node with the provided visitor.
source§fn visit_with_mut<'a, V>(
&'a mut self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>where
V: VisitorMut<'a>,
fn visit_with_mut<'a, V>(
&'a mut self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>where
V: VisitorMut<'a>,
Visit this node with the provided visitor mutably, allowing the visitor to modify private
fields.
impl StructuralPartialEq for Class
Auto Trait Implementations§
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnwindSafe for Class
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
source§impl<T> ToInternedString for Twhere
T: ToIndentedString,
impl<T> ToInternedString for Twhere
T: ToIndentedString,
source§fn to_interned_string(&self, interner: &Interner) -> String
fn to_interned_string(&self, interner: &Interner) -> String
Converts a given element to a string using an interner.