pub trait SequenceAccept<O: Output> {
// Required method
async fn accept<W>(&mut self, writable: &W) -> Result<(), O::Error>
where W: Writable<O>;
}Expand description
A collector for multiple writable values. This trait is the ingredient to WritableSeq that
represents how the sequence is handled. For example, accept can be implemented by adding
commas after each element but not the last, which can be obtained using comma_separated:
async fn write_comma_separated<O, Seq>(output: &mut O, seq: Seq) -> Result<(), O::Error> where O: Output, Seq: WritableSeq<O> {
let mut comma_sep = SeparatedSeqAccept::comma_separated(output);
seq.for_each(&mut comma_sep).await?;
Ok(())
}Required Methods§
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.