#[non_exhaustive]pub struct PluginSession { /* private fields */ }Expand description
Reusable in-process plugin session for conformance dispatch checks.
PluginSession is intentionally not cloneable: an Extism plugin instance is mutable
execution state and dispatch requires &mut self. Panics inside Extism’s wire-call path
are caught by cc_lb_runtime_protocol::dispatch::dispatch_wire_call and surface as
DispatchOutcome::Fallback with the dispatched function’s FallbackPolicy. Such a
fallback does not poison the session; later dispatches use the same plugin instance normally.
Implementations§
Source§impl PluginSession
impl PluginSession
Sourcepub fn new(wasm: &[u8]) -> Result<Self, HandshakeError>
pub fn new(wasm: &[u8]) -> Result<Self, HandshakeError>
Instantiate a plugin and run handshake with no host capabilities.
Sourcepub fn new_with_caps(
wasm: &[u8],
host_capabilities: &BTreeSet<String>,
) -> Result<Self, HandshakeError>
pub fn new_with_caps( wasm: &[u8], host_capabilities: &BTreeSet<String>, ) -> Result<Self, HandshakeError>
Instantiate a plugin and run handshake with caller-supplied host capabilities.
Sourcepub fn dispatch<F: WireFunction>(
&mut self,
request: F::Request,
) -> DispatchOutcome<F::Response>
pub fn dispatch<F: WireFunction>( &mut self, request: F::Request, ) -> DispatchOutcome<F::Response>
Dispatch one wire call through the existing plugin instance.
This mirrors the protocol layer: wire-call failures never return Result::Err and
instead become DispatchOutcome::Fallback. The call is not retried.
Auto Trait Implementations§
impl !RefUnwindSafe for PluginSession
impl !UnwindSafe for PluginSession
impl Freeze for PluginSession
impl Send for PluginSession
impl Sync for PluginSession
impl Unpin for PluginSession
impl UnsafeUnpin for PluginSession
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> 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