pub struct PythonClass {
pub name: String,
pub bases: Vec<String>,
pub methods: Vec<PythonFunction>,
pub class_vars: Vec<PythonClassVar>,
pub is_dataclass: bool,
pub is_abstract: bool,
pub decorators: Vec<String>,
pub docstring: Option<String>,
}Expand description
A Python class definition.
Fields§
§name: StringClass name
bases: Vec<String>Base classes
methods: Vec<PythonFunction>Methods
class_vars: Vec<PythonClassVar>Class variables / fields (for dataclasses)
is_dataclass: boolWhether to annotate with @dataclass
is_abstract: boolWhether to annotate with ABC base or @abstractmethod
decorators: Vec<String>Additional decorators
docstring: Option<String>Docstring
Implementations§
Trait Implementations§
Source§impl Clone for PythonClass
impl Clone for PythonClass
Source§fn clone(&self) -> PythonClass
fn clone(&self) -> PythonClass
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 PythonClass
impl Debug for PythonClass
Source§impl PartialEq for PythonClass
impl PartialEq for PythonClass
impl StructuralPartialEq for PythonClass
Auto Trait Implementations§
impl Freeze for PythonClass
impl RefUnwindSafe for PythonClass
impl Send for PythonClass
impl Sync for PythonClass
impl Unpin for PythonClass
impl UnsafeUnpin for PythonClass
impl UnwindSafe for PythonClass
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