pub struct FunctionDef {Show 16 fields
pub name: String,
pub rust_path: String,
pub original_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 return_sanitized: bool,
pub returns_ref: bool,
pub returns_cow: bool,
pub return_newtype_wrapper: Option<String>,
pub binding_excluded: bool,
pub binding_exclusion_reason: Option<String>,
}Expand description
A free function exposed to bindings.
Fields§
§name: String§rust_path: String§original_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.
return_sanitized: boolTrue if the return type was sanitized (Named replaced with String). When true, the binding-side return type is wider than the actual core return — codegen must JSON-serialize the core value rather than treating it as the binding type.
returns_ref: boolTrue if the core function returns a reference (&T, Option<&T>, etc.).
Used by code generators to insert .clone() before type conversion.
returns_cow: boolTrue if the core function returns Cow<'_, T> where T is a named type (not str/bytes).
Used by code generators to emit .into_owned() 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).
binding_excluded: boolTrue when source metadata explicitly excludes this function from generated
polyglot binding surfaces (via #[cfg_attr(alef, alef(skip))] or #[doc(hidden)]).
binding_exclusion_reason: Option<String>Human-readable reason for binding_excluded, used in diagnostics.
Trait Implementations§
Source§impl Clone for FunctionDef
impl Clone for FunctionDef
Source§fn clone(&self) -> FunctionDef
fn clone(&self) -> FunctionDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more