pub struct ClusterPeerFetchRequest {
pub owner: ClusterNodeId,
pub key: String,
pub generation: Option<ClusterGeneration>,
}Fields§
§owner: ClusterNodeIdOwner member expected to serve this request.
key: StringLogical cache key requested from the owner.
generation: Option<ClusterGeneration>Optional owner generation observed by the caller.
Implementations§
Source§impl ClusterPeerFetchRequest
impl ClusterPeerFetchRequest
Sourcepub fn new(owner: impl Into<ClusterNodeId>, key: impl Into<String>) -> Self
pub fn new(owner: impl Into<ClusterNodeId>, key: impl Into<String>) -> Self
Create a new peer-fetch request.
Sourcepub fn generation(self, generation: ClusterGeneration) -> Self
pub fn generation(self, generation: ClusterGeneration) -> Self
Attach the owner generation observed by the caller.
Sourcepub fn has_generation(&self) -> bool
pub fn has_generation(&self) -> bool
Return whether this request carries an observed owner generation.
Sourcepub fn matches_generation(&self, current: ClusterGeneration) -> bool
pub fn matches_generation(&self, current: ClusterGeneration) -> bool
Return whether this request can be served by current owner generation.
Sourcepub fn generation_mismatch(
&self,
current: ClusterGeneration,
) -> Option<ClusterPeerFetchGenerationMismatch>
pub fn generation_mismatch( &self, current: ClusterGeneration, ) -> Option<ClusterPeerFetchGenerationMismatch>
Return mismatch details when the observed owner generation is stale.
Trait Implementations§
Source§impl Clone for ClusterPeerFetchRequest
impl Clone for ClusterPeerFetchRequest
Source§fn clone(&self) -> ClusterPeerFetchRequest
fn clone(&self) -> ClusterPeerFetchRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClusterPeerFetchRequest
impl Debug for ClusterPeerFetchRequest
impl Eq for ClusterPeerFetchRequest
Source§impl PartialEq for ClusterPeerFetchRequest
impl PartialEq for ClusterPeerFetchRequest
Source§fn eq(&self, other: &ClusterPeerFetchRequest) -> bool
fn eq(&self, other: &ClusterPeerFetchRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClusterPeerFetchRequest
Auto Trait Implementations§
impl Freeze for ClusterPeerFetchRequest
impl RefUnwindSafe for ClusterPeerFetchRequest
impl Send for ClusterPeerFetchRequest
impl Sync for ClusterPeerFetchRequest
impl Unpin for ClusterPeerFetchRequest
impl UnsafeUnpin for ClusterPeerFetchRequest
impl UnwindSafe for ClusterPeerFetchRequest
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.