pub struct ClassDeclaration {
pub name: String,
pub attributes: Vec<Attribute>,
pub modifiers: Vec<String>,
pub base_types: Vec<String>,
pub type_parameters: Vec<TypeParameter>,
pub constraints: Vec<TypeParameterConstraint>,
pub members: Vec<Member>,
pub span: Range<usize>,
}Expand description
Class declaration.
Represents a class definition in C#. Classes are the primary reference types
in C# and support inheritance, interfaces, and generics.
Fields§
§name: StringThe name of the class.
attributes: Vec<Attribute>Attributes applied to the class.
modifiers: Vec<String>Modifiers like public, private, static, abstract, sealed, partial.
base_types: Vec<String>The base class and any implemented interfaces.
type_parameters: Vec<TypeParameter>Generic type parameters (e.g., T in List<T>).
constraints: Vec<TypeParameterConstraint>Constraints on generic type parameters (e.g., where T : class).
members: Vec<Member>Members of the class, including fields, properties, methods, and nested types.
span: Range<usize>Source location of the class declaration.
Trait Implementations§
Source§impl Clone for ClassDeclaration
impl Clone for ClassDeclaration
Source§fn clone(&self) -> ClassDeclaration
fn clone(&self) -> ClassDeclaration
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 ClassDeclaration
impl Debug for ClassDeclaration
Source§impl<'de> Deserialize<'de> for ClassDeclaration
impl<'de> Deserialize<'de> for ClassDeclaration
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ClassDeclaration
impl PartialEq for ClassDeclaration
Source§impl Serialize for ClassDeclaration
impl Serialize for ClassDeclaration
impl StructuralPartialEq for ClassDeclaration
Auto Trait Implementations§
impl Freeze for ClassDeclaration
impl RefUnwindSafe for ClassDeclaration
impl Send for ClassDeclaration
impl Sync for ClassDeclaration
impl Unpin for ClassDeclaration
impl UnsafeUnpin for ClassDeclaration
impl UnwindSafe for ClassDeclaration
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