pub struct PythonFunction {
pub name: String,
pub params: Vec<PythonParam>,
pub return_type: Option<PythonType>,
pub body: Vec<PythonStmt>,
pub decorators: Vec<String>,
pub is_async: bool,
pub is_classmethod: bool,
pub is_staticmethod: bool,
}Expand description
A Python function definition.
Fields§
§name: StringFunction name
params: Vec<PythonParam>Parameters
return_type: Option<PythonType>Return type annotation
body: Vec<PythonStmt>Function body
decorators: Vec<String>Decorator expressions (e.g. property, classmethod, staticmethod)
is_async: boolWhether this is an async function
is_classmethod: boolWhether this is a classmethod
is_staticmethod: boolWhether this is a staticmethod
Implementations§
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 PartialEq for PythonFunction
impl PartialEq for PythonFunction
impl StructuralPartialEq for PythonFunction
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