pub struct ReaderOptions {
pub version: Option<String>,
pub if_match: Option<String>,
pub if_none_match: Option<String>,
pub if_modified_since: Option<DateTime<Utc>>,
pub if_unmodified_since: Option<DateTime<Utc>>,
pub concurrent: usize,
pub chunk: Option<usize>,
pub gap: Option<usize>,
}
Expand description
Options for reader operations.
Fields§
§version: Option<String>
Set version
for this operation.
This option can be used to retrieve the data of a specified version of the given path.
If the version doesn’t exist, an error with kind [ErrorKind::NotFound
] will be returned.
if_match: Option<String>
Set if_match
for this operation.
This option can be used to check if the file’s ETag
matches the given ETag
.
If file exists and it’s etag doesn’t match, an error with kind [ErrorKind::ConditionNotMatch
]
will be returned.
if_none_match: Option<String>
Set if_none_match
for this operation.
This option can be used to check if the file’s ETag
doesn’t match the given ETag
.
If file exists and it’s etag match, an error with kind [ErrorKind::ConditionNotMatch
]
will be returned.
if_modified_since: Option<DateTime<Utc>>
Set if_modified_since
for this operation.
This option can be used to check if the file has been modified since the given timestamp.
If file exists and it hasn’t been modified since the specified time, an error with kind
[ErrorKind::ConditionNotMatch
] will be returned.
if_unmodified_since: Option<DateTime<Utc>>
Set if_unmodified_since
for this operation.
This feature can be used to check if the file hasn’t been modified since the given timestamp.
If file exists and it has been modified since the specified time, an error with kind
[ErrorKind::ConditionNotMatch
] will be returned.
concurrent: usize
Set concurrent
for the operation.
OpenDAL by default to read file without concurrent. This is not efficient for cases when users
read large chunks of data. By setting concurrent
, opendal will reading files concurrently
on support storage services.
By setting concurrent
, opendal will fetch chunks concurrently with
the give chunk size.
Refer to [crate::docs::performance
] for more details.
chunk: Option<usize>
Set chunk
for the operation.
OpenDAL will use services’ preferred chunk size by default. Users can set chunk based on their own needs.
Refer to [crate::docs::performance
] for more details.
gap: Option<usize>
Controls the optimization strategy for range reads in [Reader::fetch
].
When performing range reads, if the gap between two requested ranges is smaller than
the configured gap
size, OpenDAL will merge these ranges into a single read request
and discard the unrequested data in between. This helps reduce the number of API calls
to remote storage services.
This optimization is particularly useful when performing multiple small range reads that are close to each other, as it reduces the overhead of multiple network requests at the cost of transferring some additional data.
Refer to [crate::docs::performance
] for more details.
Trait Implementations§
Source§impl Clone for ReaderOptions
impl Clone for ReaderOptions
Source§fn clone(&self) -> ReaderOptions
fn clone(&self) -> ReaderOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ReaderOptions
impl Debug for ReaderOptions
Source§impl Default for ReaderOptions
impl Default for ReaderOptions
Source§fn default() -> ReaderOptions
fn default() -> ReaderOptions
Source§impl From<ReaderOptions> for (OpRead, OpReader)
impl From<ReaderOptions> for (OpRead, OpReader)
Source§fn from(value: ReaderOptions) -> Self
fn from(value: ReaderOptions) -> Self
Source§impl PartialEq for ReaderOptions
impl PartialEq for ReaderOptions
impl Eq for ReaderOptions
impl StructuralPartialEq for ReaderOptions
Auto Trait Implementations§
impl Freeze for ReaderOptions
impl RefUnwindSafe for ReaderOptions
impl Send for ReaderOptions
impl Sync for ReaderOptions
impl Unpin for ReaderOptions
impl UnwindSafe for ReaderOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.