Container

Trait Container 

Source
pub trait Container {
    // Required method
    fn fields<F, T>(&self, f: F) -> Result<T>
       where F: FnOnce(&[&dyn Encodable]) -> Result<T>;
}
Expand description

Multiple encodables in a container.

A container implementing Tagged has a blanked implementation of Encodable.

Required Methods§

Source

fn fields<F, T>(&self, f: F) -> Result<T>
where F: FnOnce(&[&dyn Encodable]) -> Result<T>,

Call the provided function with a slice of Encodable trait objects representing the fields of this message.

This method uses a callback because structs with fields which aren’t directly Encodable may need to construct temporary values from their fields prior to encoding.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§