[][src]Struct streamcatcher::TxCatcher

pub struct TxCatcher<T, Tx> { /* fields omitted */ }

A shared stream buffer, using an applied input data transform.

Implementations

impl<T, Tx> TxCatcher<T, Tx> where
    T: AsyncRead + Unpin + 'static,
    Tx: AsyncTransform<T> + Unpin + 'static, 
[src]

pub fn load_all_async(self) -> LoadAll<T, Tx>

Notable traits for LoadAll<T, Tx>

impl<T, Tx> Future for LoadAll<T, Tx> where
    T: AsyncRead + Unpin + 'static,
    Tx: AsyncTransform<T> + Unpin + 'static, 
type Output = TxCatcher<T, Tx>;
[src]

Read all bytes from the underlying stream into the backing store in the current task.

impl<T, Tx> TxCatcher<T, Tx> where
    Tx: NeedsBytes + Default
[src]

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

Create a new stream buffer using the default transform and configuration.`

pub fn with_config(source: T, config: Config) -> Result<Self>[src]

Create a new stream buffer using the default transform and a custom configuration.`

impl<T, Tx> TxCatcher<T, Tx> where
    Tx: NeedsBytes
[src]

pub fn with_tx(source: T, transform: Tx, config: Option<Config>) -> Result<Self>[src]

Create a new stream buffer using a custom transform and configuration.`

impl<T, Tx> TxCatcher<T, Tx>[src]

pub fn new_handle(&self) -> Self[src]

Acquire a new handle to this object, creating a new view of the existing cached data from the beginning.

pub fn is_finalised(&self) -> bool[src]

Returns whether the underlying stream has been finalised, i.e., whether all rope segments have been combined into a single contiguous backing store.

According to Config, this may never become true if finalisation is disabled.

pub fn is_finished(&self) -> bool[src]

Returns whether the underlying stream is finished, i.e., all bytes it will produce have been stored in some fashion.

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

Returns this handle's position.

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

Returns the number of bytes taken and stored from the transformed stream.

pub fn is_empty(&self) -> bool[src]

Returns whether any bytes have been stored from the transformed source.

pub fn builder() -> Config[src]

Returns a builder object to configure and connstruct a cache.

impl<T, Tx> TxCatcher<T, Tx> where
    T: Read + 'static,
    Tx: Transform<T> + NeedsBytes + 'static, 
[src]

pub fn spawn_loader(&self) -> JoinHandle<()>[src]

Spawn a new thread to read all bytes from the underlying stream into the backing store.

pub fn load_all(&mut self)[src]

Block the current thread to read all bytes from the underlying stream into the backing store.

Trait Implementations

impl<T, Tx> AsyncRead for TxCatcher<T, Tx> where
    T: AsyncRead + Unpin + 'static,
    Tx: AsyncTransform<T> + Unpin + 'static, 
[src]

impl<T, Tx> AsyncRead for TxCatcher<T, Tx> where
    T: AsyncRead + Unpin + 'static,
    Tx: AsyncTransform<T> + Unpin + 'static, 
[src]

impl<T, Tx> AsyncSeek for TxCatcher<T, Tx> where
    T: AsyncRead + Unpin + 'static,
    Tx: AsyncTransform<T> + Unpin + 'static, 
[src]

impl<T: Clone, Tx: Clone> Clone for TxCatcher<T, Tx>[src]

impl<T: Debug, Tx: Debug> Debug for TxCatcher<T, Tx>[src]

impl<T, Tx> Read for TxCatcher<T, Tx> where
    T: Read + 'static,
    Tx: Transform<T> + NeedsBytes + 'static, 
[src]

impl<T, Tx> Seek for TxCatcher<T, Tx> where
    T: Read + 'static,
    Tx: Transform<T> + NeedsBytes + 'static, 
[src]

impl<T, Tx> StateAccess for TxCatcher<T, Tx> where
    Tx: Stateful
[src]

type State = <Tx as Stateful>::State

Transform state.

Auto Trait Implementations

impl<T, Tx> !RefUnwindSafe for TxCatcher<T, Tx>

impl<T, Tx> Send for TxCatcher<T, Tx>

impl<T, Tx> Sync for TxCatcher<T, Tx>

impl<T, Tx> Unpin for TxCatcher<T, Tx>

impl<T, Tx> !UnwindSafe for TxCatcher<T, Tx>

Blanket Implementations

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized

impl<R> AsyncReadSkipExt for R where
    R: Send + Unpin + AsyncRead
[src]

impl<S> AsyncSeekExt for S where
    S: AsyncSeek + ?Sized
[src]

impl<S> AsyncSeekExt for S where
    S: AsyncSeek + ?Sized

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> ReadExt for T where
    T: AsyncRead + ?Sized
[src]

impl<T> SeekExt for T where
    T: AsyncSeek + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.