pub trait FromClientError {
// Required method
fn from_client_error(error: ClientError) -> Self;
}Expand description
An event type that can carry a client failure in band.
The client’s implementation of an emitted trait yields each data event
as is and, on an Err(ClientError), yields
E::from_client_error(err) and ends. Implement it on the activation’s
event enum, usually as its in-band error variant:
impl plexus_client::FromClientError for EchoEvent {
fn from_client_error(error: plexus_client::ClientError) -> Self {
EchoEvent::Error { message: error.to_string() }
}
}Required Methods§
Sourcefn from_client_error(error: ClientError) -> Self
fn from_client_error(error: ClientError) -> Self
The event that stands for error. It is the last item of its stream.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FromClientError for String
A stream of strings carries a client failure as its message — so an
activation whose events are plain Strings (a type no crate but this one
may implement the trait for) still has its trait implemented by its client.
impl FromClientError for String
A stream of strings carries a client failure as its message — so an
activation whose events are plain Strings (a type no crate but this one
may implement the trait for) still has its trait implemented by its client.