Struct asynchronous_codec::FramedWriteParts
source · pub struct FramedWriteParts<T, E> {
pub io: T,
pub encoder: E,
pub buffer: BytesMut,
/* private fields */
}Expand description
The parts obtained from FramedWrite::into_parts.
Fields§
§io: TThe underlying I/O stream.
encoder: EThe frame encoder.
buffer: BytesMutThe framed data that has been buffered but not yet flushed to io.
Implementations§
source§impl<T, E> FramedWriteParts<T, E>
impl<T, E> FramedWriteParts<T, E>
sourcepub fn map_encoder<G, F>(self, f: F) -> FramedWriteParts<T, G>where
G: Encoder,
F: FnOnce(E) -> G,
pub fn map_encoder<G, F>(self, f: F) -> FramedWriteParts<T, G>where
G: Encoder,
F: FnOnce(E) -> G,
Changes the encoder used in FramedWriteParts.