Trait Read
pub trait Read:
Unpin
+ Send
+ Sync {
// Required methods
fn open(
&self,
range: BytesRange,
) -> impl Future<Output = Result<(RpRead, Box<dyn ReadStreamDyn>), Error>> + MaybeSend;
fn read(
&self,
range: BytesRange,
) -> impl Future<Output = Result<(RpRead, Buffer), Error>> + MaybeSend;
}Expand description
Read is the internal trait used by OpenDAL to read ranges from storage.
Users should not use or import this trait unless they are implementing a Service.
This trait returns impl Future, so it is not object safe. Use ReadDyn when
type erasure is required.
Required Methods§
fn open(
&self,
range: BytesRange,
) -> impl Future<Output = Result<(RpRead, Box<dyn ReadStreamDyn>), Error>> + MaybeSend
fn open( &self, range: BytesRange, ) -> impl Future<Output = Result<(RpRead, Box<dyn ReadStreamDyn>), Error>> + MaybeSend
Open a stream of the available bytes within the given range.
A non-empty bounded forward range whose starting byte is at or beyond
EOF returns ErrorKind::RangeNotSatisfied when opening or reading the
stream. After a valid starting byte, reaching object EOF before the end
of the range is successful. The stream must never exceed the range.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".