[−][src]Struct streamcatcher::TxCatcher
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]
T: AsyncRead + Unpin + 'static,
Tx: AsyncTransform<T> + Unpin + 'static,
pub fn load_all_async(self) -> LoadAll<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]
Tx: NeedsBytes + Default,
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]
Tx: NeedsBytes,
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]
T: Read + 'static,
Tx: Transform<T> + NeedsBytes + 'static,
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]
T: AsyncRead + Unpin + 'static,
Tx: AsyncTransform<T> + Unpin + 'static,
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<IoResult<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<IoResult<usize>>
fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
impl<T, Tx> AsyncRead for TxCatcher<T, Tx> where
T: AsyncRead + Unpin + 'static,
Tx: AsyncTransform<T> + Unpin + 'static,
[src]
T: AsyncRead + Unpin + 'static,
Tx: AsyncTransform<T> + Unpin + 'static,
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<IoResult<usize>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<IoResult<usize>>
unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>]
) -> bool
[src]
&self,
buf: &mut [MaybeUninit<u8>]
) -> bool
fn poll_read_buf<B>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut B
) -> Poll<Result<usize, Error>> where
B: BufMut,
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut B
) -> Poll<Result<usize, Error>> where
B: BufMut,
impl<T, Tx> AsyncSeek for TxCatcher<T, Tx> where
T: AsyncRead + Unpin + 'static,
Tx: AsyncTransform<T> + Unpin + 'static,
[src]
T: AsyncRead + Unpin + 'static,
Tx: AsyncTransform<T> + Unpin + 'static,
fn poll_seek(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
pos: SeekFrom
) -> Poll<IoResult<u64>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
pos: SeekFrom
) -> Poll<IoResult<u64>>
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]
T: Read + 'static,
Tx: Transform<T> + NeedsBytes + 'static,
fn read(&mut self, buf: &mut [u8]) -> IoResult<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
1.36.0[src]
fn is_read_vectored(&self) -> bool
[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl<T, Tx> Seek for TxCatcher<T, Tx> where
T: Read + 'static,
Tx: Transform<T> + NeedsBytes + 'static,
[src]
T: Read + 'static,
Tx: Transform<T> + NeedsBytes + 'static,
fn seek(&mut self, pos: SeekFrom) -> IoResult<u64>
[src]
fn stream_len(&mut self) -> Result<u64, Error>
[src]
fn stream_position(&mut self) -> Result<u64, Error>
[src]
impl<T, Tx> StateAccess for TxCatcher<T, Tx> where
Tx: Stateful,
[src]
Tx: Stateful,
type State = <Tx as Stateful>::State
Transform state.
unsafe fn get_state_unchecked(&self) -> Self::State
[src]
fn get_final_state(&self) -> Option<Self::State>
[src]
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]
T: 'static + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[src]
R: AsyncRead + ?Sized,
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
fn read(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectored<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectored<'a, Self> where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_to_end(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_to_string(&'a mut self, buf: &'a mut String) -> ReadToString<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn split(self) -> (ReadHalf<Self>, WriteHalf<Self>) where
Self: AsyncWrite,
[src]
Self: AsyncWrite,
fn take(self, limit: u64) -> Take<Self>
[src]
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
R: AsyncRead + ?Sized,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
fn read_to_end(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
fn take(self, limit: u64) -> Take<Self>
fn bytes(self) -> Bytes<Self>
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
R: AsyncRead,
impl<R> AsyncReadSkipExt for R where
R: Send + Unpin + AsyncRead,
[src]
R: Send + Unpin + AsyncRead,
fn skip<'life0, 'async_trait>(
&'life0 mut Self,
usize
) -> Pin<Box<dyn Future<Output = usize> + 'async_trait + Send>> where
'life0: 'async_trait,
R: 'async_trait,
[src]
&'life0 mut Self,
usize
) -> Pin<Box<dyn Future<Output = usize> + 'async_trait + Send>> where
'life0: 'async_trait,
R: 'async_trait,
impl<S> AsyncSeekExt for S where
S: AsyncSeek + ?Sized,
[src]
S: AsyncSeek + ?Sized,
impl<S> AsyncSeekExt for S where
S: AsyncSeek + ?Sized,
S: AsyncSeek + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
[src]
T: AsyncRead + ?Sized,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
fn read_to_end(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
fn take(self, limit: u64) -> Take<Self>
[src]
fn by_ref(&mut self) -> &mut Self
[src]
fn bytes(self) -> Bytes<Self>
[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
impl<T> SeekExt for T where
T: AsyncSeek + ?Sized,
[src]
T: AsyncSeek + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,