pub trait Transport:
Send
+ Sync
+ Debug {
// Required methods
fn next_id(&self) -> String;
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 initialize<'a>(
&'a self,
clock: &'a Arc<dyn Clock>,
) -> BoxFuture<'a, Result<Value, CallError>>;
// Provided methods
fn note_timeout(&self) { ... }
fn note_answer(&self) { ... }
}Expand description
A channel to one plugin.
Required Methods§
Sourcefn 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).
Provided Methods§
Sourcefn 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.
Sourcefn note_answer(&self)
fn note_answer(&self)
A request completed (successfully or with a plugin error). Default: no-op.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".