pub struct FramedWrite<I, T: AsyncWrite + Unpin, U: Encoder<I>> { /* private fields */ }
Expand description
A wrapper for the AsyncWrite
and Encoder
types. The AsyncWrite
will be flushed when this
struct is dropped.
Implementations§
Source§impl<I, T: AsyncWrite + Unpin, U: Encoder<I>> FramedWrite<I, T, U>
impl<I, T: AsyncWrite + Unpin, U: Encoder<I>> FramedWrite<I, T, U>
pub fn new<A, C>(io: T, enc: U, ctx: &mut C) -> Selfwhere
A: Actor<Context = C> + WriteHandler<U::Error>,
C: AsyncContext<A>,
U::Error: 'static,
T: Unpin + 'static,
pub fn from_buffer<A, C>(io: T, enc: U, buffer: BytesMut, ctx: &mut C) -> Selfwhere
A: Actor<Context = C> + WriteHandler<U::Error>,
C: AsyncContext<A>,
U::Error: 'static,
T: Unpin + 'static,
Sourcepub fn set_buffer_capacity(&mut self, low: usize, high: usize)
pub fn set_buffer_capacity(&mut self, low: usize, high: usize)
Sets the write buffer capacity.
Sourcepub fn handle(&self) -> SpawnHandle
pub fn handle(&self) -> SpawnHandle
Returns the SpawnHandle
for this writer.
Trait Implementations§
Auto Trait Implementations§
impl<I, T, U> Freeze for FramedWrite<I, T, U>where
U: Freeze,
impl<I, T, U> !RefUnwindSafe for FramedWrite<I, T, U>
impl<I, T, U> !Send for FramedWrite<I, T, U>
impl<I, T, U> !Sync for FramedWrite<I, T, U>
impl<I, T, U> Unpin for FramedWrite<I, T, U>where
U: Unpin,
impl<I, T, U> !UnwindSafe for FramedWrite<I, T, U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more