Trait npyz::TypeWriteDyn

source ·
pub trait TypeWriteDyn: TypeWrite { }
Expand description

The proper trait to use for trait objects of TypeWrite.

Box<dyn TypeWrite> is useless because dyn TypeWrite has no object-safe methods. The workaround is to use Box<dyn TypeWriteDyn> instead, which itself implements TypeWrite.

Trait Implementations§

source§

impl<T: ?Sized> TypeWrite for Box<dyn TypeWriteDyn<Value = T>>

§

type Value = T

Type accepted by the function.
source§

fn write_one<W: Write>(&self, writer: W, value: &T) -> Result<()>
where Self: Sized,

The function.

Implementors§