pub struct ReadOptions {
pub timeout: Duration,
pub quorum: Quorum,
pub max_keys: usize,
pub cursor: Option<Cursor>,
}Expand description
Options for operations that read from the DHT.
Fields§
§timeout: DurationMaximum time to wait before abandoning the operation.
quorum: QuorumHow many replicas must answer before the result is returned.
max_keys: usizeMaximum number of DHT keys read to satisfy one lookup call.
A broad capability path may be spread across several keys, so a lookup can fan out. This bounds both the latency and the attacker-funded work of a single call; a truncated result reports a cursor.
cursor: Option<Cursor>Where to resume a previous lookup, if any.
Implementations§
Source§impl ReadOptions
impl ReadOptions
Sourcepub const DEFAULT_TIMEOUT: Duration
pub const DEFAULT_TIMEOUT: Duration
Default read timeout.
Sourcepub const DEFAULT_MAX_KEYS: usize = 16
pub const DEFAULT_MAX_KEYS: usize = 16
Default maximum keys read per lookup.
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Sets the timeout.
Sourcepub const fn with_quorum(self, quorum: Quorum) -> Self
pub const fn with_quorum(self, quorum: Quorum) -> Self
Sets the quorum.
Sourcepub const fn with_max_keys(self, max_keys: usize) -> Self
pub const fn with_max_keys(self, max_keys: usize) -> Self
Sets the maximum number of DHT keys read per lookup.
Sourcepub fn with_cursor(self, cursor: Cursor) -> Self
pub fn with_cursor(self, cursor: Cursor) -> Self
Resumes a lookup from a cursor returned by a previous page.
Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§impl Debug for ReadOptions
impl Debug for ReadOptions
Source§impl Default for ReadOptions
impl Default for ReadOptions
impl Eq for ReadOptions
Source§impl PartialEq for ReadOptions
impl PartialEq for ReadOptions
impl StructuralPartialEq for ReadOptions
Auto Trait Implementations§
impl Freeze for ReadOptions
impl RefUnwindSafe for ReadOptions
impl Send for ReadOptions
impl Sync for ReadOptions
impl Unpin for ReadOptions
impl UnsafeUnpin for ReadOptions
impl UnwindSafe for ReadOptions
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
Mutably borrows from an owned value. Read more