[][src]Struct kayrx::http::h2::Codec

pub struct Codec<T, B> { /* fields omitted */ }

Methods

impl<T, B> Codec<T, B> where
    T: AsyncRead + AsyncWrite + Unpin,
    B: Buf
[src]

pub fn new(io: T) -> Self[src]

Returns a new Codec with the default max frame size

pub fn with_max_recv_frame_size(io: T, max_frame_size: usize) -> Self[src]

Returns a new Codec with the given maximum frame size

impl<T, B> Codec<T, B>[src]

pub fn set_max_recv_frame_size(&mut self, val: usize)[src]

Updates the max received frame size.

The change takes effect the next time a frame is decoded. In other words, if a frame is currently in process of being decoded with a frame size greater than val but less than the max frame size in effect before calling this function, then the frame will be allowed.

pub fn max_recv_frame_size(&self) -> usize[src]

Returns the current max received frame size setting.

This is the largest size this codec will accept from the wire. Larger frames will be rejected.

pub fn max_send_frame_size(&self) -> usize[src]

Returns the max frame size that can be sent to the peer.

pub fn set_max_send_frame_size(&mut self, val: usize)[src]

Set the peer's max frame size.

pub fn set_max_recv_header_list_size(&mut self, val: usize)[src]

Set the max header list size that can be received.

pub fn get_ref(&self) -> &T[src]

Get a reference to the inner stream.

pub fn get_mut(&mut self) -> &mut T[src]

Get a mutable reference to the inner stream.

impl<T, B> Codec<T, B> where
    T: AsyncWrite + Unpin,
    B: Buf
[src]

pub fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<()>>[src]

Returns Ready when the codec can buffer a frame

pub fn buffer(&mut self, item: Frame<B>) -> Result<(), UserError>[src]

Buffer a frame.

poll_ready must be called first to ensure that a frame may be accepted.

TODO: Rename this to avoid conflicts with Sink::buffer

pub fn flush(&mut self, cx: &mut Context) -> Poll<Result<()>>[src]

Flush buffered data to the wire

pub fn shutdown(&mut self, cx: &mut Context) -> Poll<Result<()>>[src]

Shutdown the send half

Trait Implementations

impl<T: Debug, B: Debug> Debug for Codec<T, B>[src]

impl<T> From<T> for Codec<T, Bytes> where
    T: AsyncRead + AsyncWrite + Unpin
[src]

impl<T, B> Stream for Codec<T, B> where
    T: AsyncRead + Unpin
[src]

type Item = Result<Frame, RecvError>

Values yielded by the stream.

Auto Trait Implementations

impl<T, B> RefUnwindSafe for Codec<T, B> where
    B: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, B> Send for Codec<T, B> where
    B: Send,
    T: Send

impl<T, B> Sync for Codec<T, B> where
    B: Sync,
    T: Sync

impl<T, B> Unpin for Codec<T, B> where
    T: Unpin

impl<T, B> UnwindSafe for Codec<T, B> where
    B: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,