Struct BytesChunks

Source
pub struct BytesChunks<St: Stream, P> { /* private fields */ }

Implementations§

Source§

impl<St: Stream, B> BytesChunks<St, B>

Source

pub fn with_capacity(capacity: usize, stream: St) -> Self

Source

pub fn buffer(&self) -> &[u8]

Trait Implementations§

Source§

impl<St: Debug + Stream, P: Debug> Debug for BytesChunks<St, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<St: FusedStream<Item = Bytes>> FusedStream for BytesChunks<St, Bytes>

Source§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
Source§

impl<E, St: FusedStream<Item = Result<Bytes, E>>> FusedStream for BytesChunks<St, Result<Bytes, TryBytesChunksError<Bytes, E>>>

Source§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
Source§

impl<St: Stream<Item = Bytes>> Stream for BytesChunks<St, Bytes>

Source§

type Item = Bytes

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
Source§

impl<E, St: Stream<Item = Result<Bytes, E>>> Stream for BytesChunks<St, Result<Bytes, TryBytesChunksError<Bytes, E>>>

Source§

type Item = Result<Bytes, TryBytesChunksError<Bytes, E>>

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
Source§

impl<E, St: Stream<Item = Result<Vec<u8>, E>>> Stream for BytesChunks<St, Result<Bytes, TryBytesChunksError<Vec<u8>, E>>>

Source§

type Item = Result<Vec<u8>, TryBytesChunksError<Vec<u8>, E>>

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
Source§

impl<St: Stream<Item = Vec<u8>>> Stream for BytesChunks<St, Vec<u8>>

Source§

type Item = Vec<u8>

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
Source§

impl<'__pin, St: Stream, P> Unpin for BytesChunks<St, P>
where PinnedFieldsOf<__Origin<'__pin, St, P>>: Unpin,

Auto Trait Implementations§

§

impl<St, P> Freeze for BytesChunks<St, P>
where St: Freeze,

§

impl<St, P> RefUnwindSafe for BytesChunks<St, P>

§

impl<St, P> Send for BytesChunks<St, P>
where St: Send, P: Send,

§

impl<St, P> Sync for BytesChunks<St, P>
where St: Sync, P: Sync,

§

impl<St, P> UnwindSafe for BytesChunks<St, P>
where St: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BytesStream for T
where T: Stream,

Source§

fn bytes_chunks<T>(self, capacity: usize) -> BytesChunks<Self, T>
where Self: Sized,

Group bytes in chunks of capacity. Read more
Source§

fn try_bytes_chunks<T, E>( self, capacity: usize, ) -> BytesChunks<Self, Result<Bytes, TryBytesChunksError<T, E>>>
where Self: Sized,

Group result of bytes in chunks of capacity. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

type Ok = T

The type of successful values yielded by this future
Source§

type Error = E

The type of failures yielded by this future
Source§

fn try_poll_next( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

Poll this TryStream as if it were a Stream. Read more