Struct kitsune_p2p_dht::test_utils::OpStore
source · pub struct OpStore<O: OpRegion<D> = OpData, D: RegionDataConstraints = RegionData> { /* private fields */ }
Expand description
An in-memory implementation of a node’s op store
Implementations§
source§impl<D: RegionDataConstraints, O: OpRegion<D>> OpStore<O, D>
impl<D: RegionDataConstraints, O: OpRegion<D>> OpStore<O, D>
sourcepub fn new(topo: Topology, gossip_params: GossipParams) -> Self
pub fn new(topo: Topology, gossip_params: GossipParams) -> Self
Construct an empty store
Trait Implementations§
source§impl<D: RegionDataConstraints, O: OpRegion<D>> AccessOpStore<O, D> for OpStore<O, D>
impl<D: RegionDataConstraints, O: OpRegion<D>> AccessOpStore<O, D> for OpStore<O, D>
source§fn query_op_data(&self, region: &RegionCoords) -> Vec<Arc<O>>
fn query_op_data(&self, region: &RegionCoords) -> Vec<Arc<O>>
Query the actual ops inside a region
source§fn query_region_data(&self, region: &RegionCoords) -> D
fn query_region_data(&self, region: &RegionCoords) -> D
Query the RegionData of a region, including the hash of all ops, size, and count
source§fn fetch_region_set(
&self,
coords: RegionCoordSetLtcs
) -> MustBoxFuture<'_, Result<RegionSetLtcs<D>, ()>>
fn fetch_region_set( &self, coords: RegionCoordSetLtcs ) -> MustBoxFuture<'_, Result<RegionSetLtcs<D>, ()>>
Fetch a set of Regions (the coords and the data) given the set of coords
source§fn integrate_ops<Ops: Clone + Iterator<Item = Arc<O>>>(&mut self, ops: Ops)
fn integrate_ops<Ops: Clone + Iterator<Item = Arc<O>>>(&mut self, ops: Ops)
Integrate incoming ops, updating the necessary stores
source§fn gossip_params(&self) -> GossipParams
fn gossip_params(&self) -> GossipParams
Get the GossipParams associated with this store
source§fn integrate_op(&mut self, op: Arc<O>)
fn integrate_op(&mut self, op: Arc<O>)
Integrate a single op
source§fn region_set(&self, arq_set: ArqSet, now: TimeQuantum) -> RegionSet<D>
fn region_set(&self, arq_set: ArqSet, now: TimeQuantum) -> RegionSet<D>
Get the RegionSet for this node, suitable for gossiping
Auto Trait Implementations§
impl<O = OpData, D = RegionData> !Freeze for OpStore<O, D>
impl<O, D> RefUnwindSafe for OpStore<O, D>where
D: DeserializeOwned + for<'de> Deserialize<'de> + Serialize + Debug + Sync + Send + Clone + Sub<Output = D> + AddAssign + Zero<Output = D> + Add + Eq + PartialEq + RefUnwindSafe,
O: Debug + Sync + Send + Ord + Eq + PartialEq + PartialOrd + RefUnwindSafe,
impl<O, D> Send for OpStore<O, D>
impl<O, D> Sync for OpStore<O, D>
impl<O, D> Unpin for OpStore<O, D>
impl<O, D> UnwindSafe for OpStore<O, D>where
D: DeserializeOwned + for<'de> Deserialize<'de> + Serialize + Debug + Sync + Send + Clone + Sub<Output = D> + AddAssign + Zero<Output = D> + Add + Eq + PartialEq + UnwindSafe,
O: Debug + Sync + Send + Ord + Eq + PartialEq + PartialOrd + RefUnwindSafe,
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.