pub struct RhaiLoader { /* private fields */ }Expand description
Rhai loader.
Holds the host-fn registry; one loader can serve many plugins. Cheap
to clone (host fns are Arc’d closures).
Implementations§
Source§impl RhaiLoader
impl RhaiLoader
Sourcepub fn host_fns_mut(&mut self) -> &mut RhaiHostFnRegistry
pub fn host_fns_mut(&mut self) -> &mut RhaiHostFnRegistry
Mutable access to the host-fn registry for the host to register its capability-gated functions before any plugin is loaded.
Sourcepub fn host_fns(&self) -> &RhaiHostFnRegistry
pub fn host_fns(&self) -> &RhaiHostFnRegistry
Read access to the host-fn registry.
Sourcepub fn host_fn_count(&self) -> usize
pub fn host_fn_count(&self) -> usize
Number of host fns currently registered.
Sourcepub fn with_kms(self, kms: Arc<dyn KmsProvider>) -> Self
pub fn with_kms(self, kms: Arc<dyn KmsProvider>) -> Self
Attach a KMS provider backing uni.kms.* (builder style).
Sourcepub fn with_secret_store(self, store: Arc<SecretStore>) -> Self
pub fn with_secret_store(self, store: Arc<SecretStore>) -> Self
Attach a secret store backing uni.secret.acquire (builder style).
Sourcepub fn with_http(self, http: Arc<dyn HttpEgress>) -> Self
pub fn with_http(self, http: Arc<dyn HttpEgress>) -> Self
Attach an HTTP egress backing uni.http.* (builder style).
Sourcepub fn kms(&self) -> Option<Arc<dyn KmsProvider>>
pub fn kms(&self) -> Option<Arc<dyn KmsProvider>>
Clone of the configured KMS provider handle, if any.
Sourcepub fn secret_store(&self) -> Option<Arc<SecretStore>>
pub fn secret_store(&self) -> Option<Arc<SecretStore>>
Clone of the configured secret store handle, if any.
Sourcepub fn http(&self) -> Option<Arc<dyn HttpEgress>>
pub fn http(&self) -> Option<Arc<dyn HttpEgress>>
Clone of the configured HTTP egress handle, if any.
Sourcepub fn load(
&self,
script: &str,
registrar: &mut PluginRegistrar<'_>,
registrar_caps: &CapabilitySet,
) -> Result<LoadOutcome, RhaiError>
pub fn load( &self, script: &str, registrar: &mut PluginRegistrar<'_>, registrar_caps: &CapabilitySet, ) -> Result<LoadOutcome, RhaiError>
Load a Rhai script into a PluginRegistrar.
The caller is responsible for calling
registrar.commit_to_registry() on success.
registrar_caps is the host grant set — what capabilities
the host is willing to give this plugin. The effective set is
the intersection of registrar_caps and the manifest’s
declared capability set. Granted-but-not-declared capabilities
are silently ignored (least-authority); declared-but-not-granted
are surfaced as denied_capabilities.
Trait Implementations§
Source§impl Clone for RhaiLoader
impl Clone for RhaiLoader
Source§fn clone(&self) -> RhaiLoader
fn clone(&self) -> RhaiLoader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RhaiLoader
impl Debug for RhaiLoader
Source§impl Default for RhaiLoader
impl Default for RhaiLoader
Source§fn default() -> RhaiLoader
fn default() -> RhaiLoader
Auto Trait Implementations§
impl !RefUnwindSafe for RhaiLoader
impl !UnwindSafe for RhaiLoader
impl Freeze for RhaiLoader
impl Send for RhaiLoader
impl Sync for RhaiLoader
impl Unpin for RhaiLoader
impl UnsafeUnpin for RhaiLoader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreimpl<T> PluginState for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.