pub struct PluginHandle { /* private fields */ }Expand description
A handle to a specific plugin for making calls.
Implementations§
Source§impl PluginHandle
impl PluginHandle
Sourcepub async fn call_response(
&self,
entry: &str,
payload: &[u8],
) -> Result<(NrStatus, Vec<u8>)>
pub async fn call_response( &self, entry: &str, payload: &[u8], ) -> Result<(NrStatus, Vec<u8>)>
Call a plugin entry point with a request-response pattern.
Sourcepub async fn call_response_timeout(
&self,
entry: &str,
payload: &[u8],
timeout: Duration,
) -> Result<(NrStatus, Vec<u8>)>
pub async fn call_response_timeout( &self, entry: &str, payload: &[u8], timeout: Duration, ) -> Result<(NrStatus, Vec<u8>)>
Like PluginHandle::call_response but bounded by a timeout.
If the plugin does not deliver a response within timeout, the pending
entry is removed from the host’s tracking map and Err(Timeout) is
returned. Use this for any production caller that cannot afford to
hang indefinitely on a misbehaving plugin.
Sourcepub async fn call_response_fast(
&self,
entry: &str,
payload: &[u8],
) -> Result<(NrStatus, Vec<u8>)>
pub async fn call_response_fast( &self, entry: &str, payload: &[u8], ) -> Result<(NrStatus, Vec<u8>)>
Ultra-fast unary call for synchronous plugins.
Sourcepub async fn call(&self, entry: &str, payload: &[u8]) -> Result<NrStatus>
pub async fn call(&self, entry: &str, payload: &[u8]) -> Result<NrStatus>
Fire-and-forget call to a plugin entry point.
Sourcepub async fn call_stream(
&self,
entry: &str,
payload: &[u8],
) -> Result<(u64, StreamReceiver)>
pub async fn call_stream( &self, entry: &str, payload: &[u8], ) -> Result<(u64, StreamReceiver)>
Call a plugin entry point with a streaming response pattern.
Sourcepub fn send_stream_data(&self, sid: u64, data: &[u8]) -> Result<NrStatus>
pub fn send_stream_data(&self, sid: u64, data: &[u8]) -> Result<NrStatus>
Send data to an active stream.
Sourcepub fn close_stream(&self, sid: u64) -> Result<NrStatus>
pub fn close_stream(&self, sid: u64) -> Result<NrStatus>
Close an active stream from the host side.
Trait Implementations§
Source§impl Clone for PluginHandle
impl Clone for PluginHandle
Source§fn clone(&self) -> PluginHandle
fn clone(&self) -> PluginHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PluginHandle
impl !UnwindSafe for PluginHandle
impl Freeze for PluginHandle
impl Send for PluginHandle
impl Sync for PluginHandle
impl Unpin for PluginHandle
impl UnsafeUnpin for PluginHandle
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
Mutably borrows from an owned value. Read more