Skip to main content

FromClientError

Trait FromClientError 

Source
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.

RETURNS-47: no longer required of anything — the generated client implements no trait and answers Result<T, ClientError> — and kept for the code that implements it. Before, the client’s implementation of an emitted trait yielded a client failure as E::from_client_error(err). An event enum carried it 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§

Source

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 string carries a client failure as its message.

Source§

impl<T, E: FromClientError> FromClientError for Result<T, E>

A Result item carries a client failure as its error (RETURNS-36).

Implementors§

Source§

impl<T: FromClientError, P> FromClientError for Progress<T, P>

A progress item carries a client failure as its item (RETURNS-36).