pub struct PythonFunction {
pub name: String,
pub docstring: Option<String>,
pub signature_str: String,
pub signature: PythonFunctionSig,
pub decorators: Vec<String>,
pub is_async: bool,
pub is_staticmethod: bool,
pub is_classmethod: bool,
pub is_property: bool,
pub parsed_doc: Option<ParsedDocstring>,
pub rust_impl: Option<RustItemRef>,
pub source: SourceSpan,
}Expand description
A Python function
Fields§
§name: String§docstring: Option<String>§signature_str: StringFull signature as string for display
signature: PythonFunctionSigParsed signature for structured access
decorators: Vec<String>§is_async: bool§is_staticmethod: bool§is_classmethod: bool§is_property: bool§parsed_doc: Option<ParsedDocstring>§rust_impl: Option<RustItemRef>§source: SourceSpanImplementations§
Source§impl PythonFunction
impl PythonFunction
pub fn with_docstring(self, doc: impl Into<String>) -> Self
pub fn with_signature(self, sig: impl Into<String>) -> Self
pub fn with_param(self, param: PythonParam) -> Self
pub fn with_return_type(self, ty: impl Into<String>) -> Self
pub fn with_decorator(self, decorator: impl Into<String>) -> Self
pub fn async_(self) -> Self
pub fn staticmethod(self) -> Self
pub fn classmethod(self) -> Self
pub fn property(self) -> 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 PythonFunction
impl Clone for PythonFunction
Source§fn clone(&self) -> PythonFunction
fn clone(&self) -> PythonFunction
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 PythonFunction
impl Debug for PythonFunction
Source§impl<'de> Deserialize<'de> for PythonFunction
impl<'de> Deserialize<'de> for PythonFunction
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 PythonFunction
impl RefUnwindSafe for PythonFunction
impl Send for PythonFunction
impl Sync for PythonFunction
impl Unpin for PythonFunction
impl UnsafeUnpin for PythonFunction
impl UnwindSafe for PythonFunction
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