Skip to main content

ServableOwned

Trait ServableOwned 

Source
pub trait ServableOwned: for<'de> ServableRead<'de> + Default { }
Expand description

A response a client decodes into: readable in both formats, and owning its own contents.

ServableRead carries the frame’s lifetime, which is what lets a server borrow out of the body it was handed. A client cannot: it decodes out of a response message it owns locally and then returns the value, so the value has to outlive the frame it came from. for<'de> says exactly that, and Default is there because structio reads into an existing value.

The bound is both formats rather than the one the request used, because a server answers in the format the frame asked for and a client that names a result type does not get to assume which one came back.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: for<'de> ServableRead<'de> + Default> ServableOwned for T