pub struct RustFunction {
pub name: String,
pub visibility: Visibility,
pub doc_comment: Option<String>,
pub parsed_doc: Option<ParsedDocstring>,
pub generics: Option<String>,
pub signature_str: String,
pub signature: RustFunctionSig,
pub is_async: bool,
pub is_unsafe: bool,
pub is_const: bool,
pub pyfunction: Option<PyFunctionMeta>,
pub source: SourceSpan,
}Expand description
A Rust function definition
Fields§
§name: String§visibility: Visibility§doc_comment: Option<String>§parsed_doc: Option<ParsedDocstring>§generics: Option<String>Generic parameters as string, e.g. “<’a, T: Clone>”
signature_str: StringFull signature as string for display
signature: RustFunctionSigParsed signature for structured access
is_async: bool§is_unsafe: bool§is_const: bool§pyfunction: Option<PyFunctionMeta>§source: SourceSpanImplementations§
Source§impl RustFunction
impl RustFunction
pub fn with_doc(self, doc: impl Into<String>) -> Self
pub fn with_generics(self, generics: impl Into<String>) -> Self
pub fn with_signature(self, sig: impl Into<String>) -> Self
pub fn with_param(self, param: RustParam) -> Self
pub fn with_return_type(self, ty: impl Into<String>) -> Self
pub fn async_(self) -> Self
pub fn unsafe_(self) -> Self
pub fn const_(self) -> Self
pub fn with_pyfunction(self, meta: PyFunctionMeta) -> Self
pub fn with_source(self, source: SourceSpan) -> Self
Trait Implementations§
Source§impl Clone for RustFunction
impl Clone for RustFunction
Source§fn clone(&self) -> RustFunction
fn clone(&self) -> RustFunction
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 RustFunction
impl Debug for RustFunction
Source§impl<'de> Deserialize<'de> for RustFunction
impl<'de> Deserialize<'de> for RustFunction
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 RustFunction
impl RefUnwindSafe for RustFunction
impl Send for RustFunction
impl Sync for RustFunction
impl Unpin for RustFunction
impl UnsafeUnpin for RustFunction
impl UnwindSafe for RustFunction
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