Skip to main content

Stream

Struct Stream 

Source
pub struct Stream { /* private fields */ }
Expand description

A recording decoded as its bytes come.

Implementations§

Source§

impl Stream

Source

pub fn new() -> Self

Source

pub fn push(&mut self, bytes: &[u8]) -> Result<usize, Error>

Decodes what bytes complete: how many records came. A cut record waits for the next push; bytes that are no recording are an error, and so is a header of another version.

Source

pub fn reset(&mut self)

Starts again, as a source that began a new recording asks.

Source

pub fn trace(&self) -> &Trace

The recording so far.

Source

pub fn timeline(&self) -> &Timeline

The timeline so far.

Source

pub fn started(&self) -> bool

Whether the header has come.

Source

pub fn pending(&self) -> usize

The bytes of a record cut short, waiting for the rest.

Source

pub fn poll(&mut self, t: &mut dyn Transport) -> Result<Polled, PollError>

Reads what t has into the stream: Polled::More with the records that came, Polled::Idle, Polled::Ended, or Polled::Reset after starting again for a new recording.

Trait Implementations§

Source§

impl Default for Stream

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.