pub struct ForeignFunctionEntry {
pub name: String,
pub language: String,
pub body_text: String,
pub param_names: Vec<String>,
pub param_types: Vec<String>,
pub return_type: Option<String>,
pub arg_count: u16,
pub is_async: bool,
pub dynamic_errors: bool,
pub return_type_schema_id: Option<u32>,
pub content_hash: Option<[u8; 32]>,
pub native_abi: Option<NativeAbiSpec>,
}Expand description
Metadata for a foreign function stored in the program. The compiler creates these; the engine links them to language runtimes before execution.
Fields§
§name: String§language: String§body_text: String§param_names: Vec<String>§param_types: Vec<String>§return_type: Option<String>§arg_count: u16§is_async: bool§dynamic_errors: boolWhether this foreign function’s runtime has a dynamic error model.
When true, the executor wraps results in Result<T> (Ok/Err).
Defaults to true at compile time (safe default); overridden at link
time from the actual runtime’s ErrorModel.
return_type_schema_id: Option<u32>Schema ID for the return type when it contains an inline object type.
Set at compile time by compile_foreign_function(). Used by the
executor to construct HeapValue::TypedObject from msgpack Maps.
content_hash: Option<[u8; 32]>Content hash for caching and deduplication. Computed from (language, body_text, param_types, return_type).
native_abi: Option<NativeAbiSpec>Native C ABI metadata for extern "C" declarations.
When present, the VM links this function through the internal C ABI path instead of a language-runtime extension.
Implementations§
Source§impl ForeignFunctionEntry
impl ForeignFunctionEntry
Sourcepub fn compute_content_hash(&mut self)
pub fn compute_content_hash(&mut self)
Compute a content hash from (language, body_text, param_types, return_type).
Trait Implementations§
Source§impl Clone for ForeignFunctionEntry
impl Clone for ForeignFunctionEntry
Source§fn clone(&self) -> ForeignFunctionEntry
fn clone(&self) -> ForeignFunctionEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ForeignFunctionEntry
impl Debug for ForeignFunctionEntry
Source§impl<'de> Deserialize<'de> for ForeignFunctionEntry
impl<'de> Deserialize<'de> for ForeignFunctionEntry
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>,
Auto Trait Implementations§
impl Freeze for ForeignFunctionEntry
impl RefUnwindSafe for ForeignFunctionEntry
impl Send for ForeignFunctionEntry
impl Sync for ForeignFunctionEntry
impl Unpin for ForeignFunctionEntry
impl UnsafeUnpin for ForeignFunctionEntry
impl UnwindSafe for ForeignFunctionEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more