Trait fizyr_rpc::Body [−][src]
pub trait Body: Send + Sync + Sized + 'static {
fn empty() -> Self;
fn from_error(message: &str) -> Self;
fn as_error(&self) -> Result<&str, Utf8Error>;
fn into_error(self) -> Result<String, FromUtf8Error>;
}
Expand description
Trait for types that can be used as message body.
Required methods
fn from_error(message: &str) -> Self
fn from_error(message: &str) -> Self
Create a message body from an error message.
Interpret a body as error message.
You should only call this if you know that the body represent an error message.
fn into_error(self) -> Result<String, FromUtf8Error>
fn into_error(self) -> Result<String, FromUtf8Error>
Interpret a body as error message.
You should only call this if you know that the body represent an error message.