pub struct FunctionDef {
pub name: String,
pub rust_path: String,
pub params: Vec<ParamDef>,
pub return_type: TypeRef,
pub is_async: bool,
pub error_type: Option<String>,
pub doc: String,
pub cfg: Option<String>,
pub sanitized: bool,
pub returns_ref: bool,
pub return_newtype_wrapper: Option<String>,
}Expand description
A free function exposed to bindings.
Fields§
§name: String§rust_path: String§params: Vec<ParamDef>§return_type: TypeRef§is_async: bool§error_type: Option<String>§doc: String§cfg: Option<String>§sanitized: boolTrue if any param or return type was sanitized during unknown type resolution.
returns_ref: boolTrue if the core function returns a reference (&T, Option<&T>, etc.).
Used by code generators to insert .clone() before type conversion.
return_newtype_wrapper: Option<String>Full Rust path of the newtype wrapper that was resolved away for the return type.
When set, codegen must unwrap the returned newtype value (e.g. result.0).
Trait Implementations§
Source§impl Clone for FunctionDef
impl Clone for FunctionDef
Source§fn clone(&self) -> FunctionDef
fn clone(&self) -> FunctionDef
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 FunctionDef
impl Debug for FunctionDef
Source§impl<'de> Deserialize<'de> for FunctionDef
impl<'de> Deserialize<'de> for FunctionDef
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 FunctionDef
impl RefUnwindSafe for FunctionDef
impl Send for FunctionDef
impl Sync for FunctionDef
impl Unpin for FunctionDef
impl UnsafeUnpin for FunctionDef
impl UnwindSafe for FunctionDef
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