pub trait ToByteStreamUsing {
type Context;
type Error;
// Required method
fn to_writer<W: ByteWrite + ?Sized>(
&self,
w: &mut W,
context: Self::Context,
) -> Result<(), Self::Error>
where Self: Sized;
// Provided method
fn bytes<C: Counter>(
&self,
context: Self::Context,
) -> Result<C, Self::Error>
where Self: Sized { ... }
}
Expand description
Implemented by complex types that consume additional context to build themselves to a writer