pub struct HostFnRegistry { /* private fields */ }Expand description
Registry of host functions available to Extism plugins.
The host populates this once per uni-db instance with all gateable
imports (host_fs_read, host_net_http_get, host_query_run,
host_kms_sign, host_secrets_acquire, etc). At plugin load time,
the loader filters the registry through the plugin’s granted
capability set and registers only the matching host fns into the
Extism plugin’s import table.
The capability check at call time is mechanical: each gated host fn
looks up its HostFnSpec in the registry and verifies the plugin’s
grants. Plugins that bypass the capability check (because the host
author forgot) cannot exist — every host fn invocation routes
through the registry’s check helper.
§Status
M6a scaffolding: the public API surface is in place; the actual
Function registration into Extism’s runtime arrives in the cutover.
Implementations§
Source§impl HostFnRegistry
impl HostFnRegistry
Sourcepub fn register(&mut self, spec: HostFnSpec)
pub fn register(&mut self, spec: HostFnSpec)
Register a host fn spec.
Sourcepub fn get(&self, name: &str) -> Option<&HostFnSpec>
pub fn get(&self, name: &str) -> Option<&HostFnSpec>
Look up a registered spec by name.
Sourcepub fn iter(&self) -> impl Iterator<Item = &HostFnSpec>
pub fn iter(&self) -> impl Iterator<Item = &HostFnSpec>
Iterate all registered specs.
Trait Implementations§
Source§impl Debug for HostFnRegistry
impl Debug for HostFnRegistry
Source§impl Default for HostFnRegistry
impl Default for HostFnRegistry
Source§fn default() -> HostFnRegistry
fn default() -> HostFnRegistry
Auto Trait Implementations§
impl Freeze for HostFnRegistry
impl RefUnwindSafe for HostFnRegistry
impl Send for HostFnRegistry
impl Sync for HostFnRegistry
impl Unpin for HostFnRegistry
impl UnsafeUnpin for HostFnRegistry
impl UnwindSafe for HostFnRegistry
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§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