pub trait SeekableStream:
AsyncRead
+ Unpin
+ Debug
+ Send
+ Sync
+ DynClone {
// Required methods
fn reset<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn len(&self) -> Option<u64>;
// Provided methods
fn is_empty(&self) -> Option<bool> { ... }
fn buffer_size(&self) -> usize { ... }
}Expand description
Enable a type implementing AsyncRead to be consumed as if it were a Stream of Bytes.
Required Methods§
Provided Methods§
Sourcefn buffer_size(&self) -> usize
fn buffer_size(&self) -> usize
Returns the size of the buffer to use when reading from the stream.
Trait Implementations§
Source§impl<'clone> Clone for Box<dyn SeekableStream + 'clone>
impl<'clone> Clone for Box<dyn SeekableStream + 'clone>
Source§impl Stream for dyn SeekableStream
impl Stream for dyn SeekableStream
Source§fn poll_next(
self: Pin<&mut (dyn SeekableStream + 'static)>,
cx: &mut Context<'_>,
) -> Poll<Option<<dyn SeekableStream as Stream>::Item>>
fn poll_next( self: Pin<&mut (dyn SeekableStream + 'static)>, cx: &mut Context<'_>, ) -> Poll<Option<<dyn SeekableStream as Stream>::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 moreDyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".