pub struct HttpTransport { /* private fields */ }Expand description
A plugin served over HTTP.
Implementations§
Source§impl HttpTransport
impl HttpTransport
pub fn new( plugin: &LoadedManifest, runtime: HttpRuntime, ) -> Result<Self, CallError>
Trait Implementations§
Source§impl Debug for HttpTransport
impl Debug for HttpTransport
Source§impl Transport for HttpTransport
impl Transport for HttpTransport
Source§fn call<'a>(
&'a self,
id: String,
method: &'a str,
params: Value,
sink: Option<NotifySink>,
_cancel_on_drop: bool,
clock: &'a Arc<dyn Clock>,
) -> BoxFuture<'a, Result<Value, CallError>>
fn call<'a>( &'a self, id: String, method: &'a str, params: Value, sink: Option<NotifySink>, _cancel_on_drop: bool, clock: &'a Arc<dyn Clock>, ) -> BoxFuture<'a, Result<Value, CallError>>
Send request
id and wait for the response. Notifications carrying
request_id == id are passed to sink. Dropping the future abandons the
request (and cancels it when cancel_on_drop is set).Source§fn initialize<'a>(
&'a self,
clock: &'a Arc<dyn Clock>,
) -> BoxFuture<'a, Result<Value, CallError>>
fn initialize<'a>( &'a self, clock: &'a Arc<dyn Clock>, ) -> BoxFuture<'a, Result<Value, CallError>>
Run the
initialize handshake (starting the plugin if needed) and return its result.Source§fn note_timeout(&self)
fn note_timeout(&self)
A request was abandoned after its timeout. Transports supervising a process
use this to restart a plugin that stopped answering. Default: no-op.
Source§fn note_answer(&self)
fn note_answer(&self)
A request completed (successfully or with a plugin error). Default: no-op.
Auto Trait Implementations§
impl !Freeze for HttpTransport
impl !RefUnwindSafe for HttpTransport
impl !UnwindSafe for HttpTransport
impl Forget for HttpTransport
impl Move for HttpTransport
impl Send for HttpTransport
impl Sync for HttpTransport
impl Unpin for HttpTransport
impl UnsafeUnpin for HttpTransport
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