[−][src]Trait tower_web::util::buf_stream::FromBufStream
Conversion from a BufStream.
By implementing FromBufStream for a type, you define how it will be
created from a buf stream. This is common for types which describe byte
storage of some kind.
FromBufStream is rarely called explicitly, and it is instead used through
BufStream's collect method.
Associated Types
type Builder
Type that is used to build Self while the BufStream is being
consumed.
Required Methods
fn builder(hint: &SizeHint) -> Self::Builder
Create a new, empty, builder. The provided hint can be used to inform
reserving capacity.
fn extend<T: Buf>(builder: &mut Self::Builder, buf: &mut T)
Extend the builder with the Buf.
This method is called whenever a new Buf value is obtained from the
buf stream.
fn build(builder: Self::Builder) -> Self
Finalize the building of Self.
Called once the buf stream is fully consumed.
Implementations on Foreign Types
impl FromBufStream for Vec<u8>[src]
impl FromBufStream for Vec<u8>type Builder = Vec<u8>
fn builder(hint: &SizeHint) -> Vec<u8>[src]
fn builder(hint: &SizeHint) -> Vec<u8>fn extend<T: Buf>(builder: &mut Self, buf: &mut T)[src]
fn extend<T: Buf>(builder: &mut Self, buf: &mut T)fn build(builder: Self) -> Self[src]
fn build(builder: Self) -> Selfimpl FromBufStream for Bytes[src]
impl FromBufStream for Bytestype Builder = BytesMut
fn builder(hint: &SizeHint) -> BytesMut[src]
fn builder(hint: &SizeHint) -> BytesMutfn extend<T: Buf>(builder: &mut Self::Builder, buf: &mut T)[src]
fn extend<T: Buf>(builder: &mut Self::Builder, buf: &mut T)fn build(builder: Self::Builder) -> Self[src]
fn build(builder: Self::Builder) -> Self