pub trait Consume<T> {
// Required method
fn consume(&self) -> T;
}Expand description
Derive a read view from a handle.
Lets APIs accept either a producer or a consumer (e.g.
Client::with_publisher,
Request::accept). The blanket &T impl means you can
pass by value (foo(x)) to hand off ownership, or by reference (foo(&x))
to keep it, without spelling out .consume().
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".