pub struct NativeCapability { /* private fields */ }
Expand description
Represents a native capability provider compiled as a shared object library.
These plugins are OS- and architecture-specific, so they will be .so
files on Linux, .dylib
files on macOS, etc.
Implementations§
Source§impl NativeCapability
impl NativeCapability
Sourcepub fn from_file<P: AsRef<OsStr>>(
filename: P,
binding_target_name: Option<String>,
) -> Result<Self>
pub fn from_file<P: AsRef<OsStr>>( filename: P, binding_target_name: Option<String>, ) -> Result<Self>
Reads a capability provider from a file. The capability provider must implement the correct FFI interface to support waSCC plugins. See wascc.dev for documentation and tutorials on how to create a native capability provider
Sourcepub fn from_instance(
instance: impl CapabilityProvider,
binding_target_name: Option<String>,
) -> Result<Self>
pub fn from_instance( instance: impl CapabilityProvider, binding_target_name: Option<String>, ) -> Result<Self>
This function is to be used for capability embedding. If you are building a custom
waSCC host and have a fixed set of capabilities that you want to always be available
to actors, then you can declare a dependency on the capability provider, enable
the static_plugin
feature, and provide an instance of that provider. Be sure to check
that the provider supports capability embedding.
Sourcepub fn descriptor(&self) -> &CapabilityDescriptor
pub fn descriptor(&self) -> &CapabilityDescriptor
Returns the full descriptor for the capability provider
Auto Trait Implementations§
impl Freeze for NativeCapability
impl !RefUnwindSafe for NativeCapability
impl Send for NativeCapability
impl Sync for NativeCapability
impl Unpin for NativeCapability
impl !UnwindSafe for NativeCapability
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> 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> 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