pub struct PythonClass {
pub name: String,
pub docstring: Option<String>,
pub parsed_doc: Option<ParsedDocstring>,
pub bases: Vec<String>,
pub methods: Vec<PythonFunction>,
pub attributes: Vec<PythonVariable>,
pub decorators: Vec<String>,
pub rust_impl: Option<RustItemRef>,
pub source: SourceSpan,
}Expand description
A Python class
Fields§
§name: String§docstring: Option<String>§parsed_doc: Option<ParsedDocstring>§bases: Vec<String>§methods: Vec<PythonFunction>§attributes: Vec<PythonVariable>§decorators: Vec<String>§rust_impl: Option<RustItemRef>§source: SourceSpanImplementations§
Source§impl PythonClass
impl PythonClass
pub fn with_docstring(self, doc: impl Into<String>) -> Self
pub fn with_base(self, base: impl Into<String>) -> Self
pub fn with_method(self, method: PythonFunction) -> Self
pub fn with_attribute(self, attr: PythonVariable) -> Self
pub fn with_decorator(self, decorator: impl Into<String>) -> Self
pub fn with_rust_impl(self, rust_ref: RustItemRef) -> Self
pub fn with_source(self, source: SourceSpan) -> Self
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<'de> Deserialize<'de> for PythonClass
impl<'de> Deserialize<'de> for PythonClass
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
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