Struct holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dht::region::RegionData
pub struct RegionData {
pub hash: RegionHash,
pub size: u32,
pub count: u32,
}
Expand description
The pertinent data that we care about for each Region. This is what gets sent over gossip so that nodes can discover which Regions are different between them.
The size and count data can also act as heuristics to help us fine-tune the gossip algorithm, although currently they are unused (except for the purpose of disambiguation in the rare case of an XOR hash collision).
Fields§
§hash: RegionHash
The XOR of hashes of all Ops in this Region
size: u32
The total size of Op data contained in this Region
count: u32
The number of Ops in this Region.
Trait Implementations§
§impl AccessOpStore<OpData, RegionData> for TestNode
impl AccessOpStore<OpData, RegionData> for TestNode
§fn query_op_data(
&self,
region: &RegionCoords
) -> Vec<Arc<OpData, Global>, Global>
fn query_op_data( &self, region: &RegionCoords ) -> Vec<Arc<OpData, Global>, Global>
Query the actual ops inside a region
§fn query_region_data(&self, region: &RegionCoords) -> RegionData
fn query_region_data(&self, region: &RegionCoords) -> RegionData
Query the RegionData of a region, including the hash of all ops, size, and count
§fn fetch_region_set(
&self,
coords: RegionCoordSetLtcs
) -> MustBoxFuture<'_, Result<RegionSetLtcs<RegionData>, ()>> ⓘ
fn fetch_region_set( &self, coords: RegionCoordSetLtcs ) -> MustBoxFuture<'_, Result<RegionSetLtcs<RegionData>, ()>> ⓘ
Fetch a set of Regions (the coords and the data) given the set of coords
§fn integrate_ops<Ops>(&mut self, ops: Ops)where
Ops: Clone + Iterator<Item = Arc<OpData, Global>>,
fn integrate_ops<Ops>(&mut self, ops: Ops)where Ops: Clone + Iterator<Item = Arc<OpData, Global>>,
Integrate incoming ops, updating the necessary stores
§fn gossip_params(&self) -> GossipParams
fn gossip_params(&self) -> GossipParams
Get the GossipParams associated with this store
§fn integrate_op(&mut self, op: Arc<O, Global>)
fn integrate_op(&mut self, op: Arc<O, Global>)
Integrate a single op
§fn region_set(
&self,
arq_set: ArqSet<SpaceOffset>,
now: TimeQuantum
) -> RegionSet<D>
fn region_set( &self, arq_set: ArqSet<SpaceOffset>, now: TimeQuantum ) -> RegionSet<D>
Get the RegionSet for this node, suitable for gossiping
§impl Add<RegionData> for RegionData
impl Add<RegionData> for RegionData
§type Output = RegionData
type Output = RegionData
The resulting type after applying the
+
operator.§fn add(self, other: RegionData) -> <RegionData as Add<RegionData>>::Output
fn add(self, other: RegionData) -> <RegionData as Add<RegionData>>::Output
Performs the
+
operation. Read more§impl AddAssign<RegionData> for RegionData
impl AddAssign<RegionData> for RegionData
§fn add_assign(&mut self, other: RegionData)
fn add_assign(&mut self, other: RegionData)
Performs the
+=
operation. Read more§impl Clone for RegionData
impl Clone for RegionData
§fn clone(&self) -> RegionData
fn clone(&self) -> RegionData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for RegionData
impl Debug for RegionData
§impl<'de> Deserialize<'de> for RegionData
impl<'de> Deserialize<'de> for RegionData
§fn deserialize<__D>(
__deserializer: __D
) -> Result<RegionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<RegionData, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<RegionData> for RegionDataCompact
impl From<RegionData> for RegionDataCompact
§fn from(d: RegionData) -> RegionDataCompact
fn from(d: RegionData) -> RegionDataCompact
Converts to this type from the input type.
§impl From<RegionDataCompact> for RegionData
impl From<RegionDataCompact> for RegionData
§fn from(_: RegionDataCompact) -> RegionData
fn from(_: RegionDataCompact) -> RegionData
Converts to this type from the input type.
source§impl OpRegion<RegionData> for DhtOp
impl OpRegion<RegionData> for DhtOp
source§fn loc(&self) -> DhtLocation
fn loc(&self) -> DhtLocation
The op’s Location
source§fn region_data(&self) -> RegionData
fn region_data(&self) -> RegionData
The RegionData that would be produced if this op were the only op
in the region. The sum of these produces the RegionData for the whole
region.
source§fn bound(_timestamp: Timestamp, _loc: DhtLocation) -> DhtOp
fn bound(_timestamp: Timestamp, _loc: DhtLocation) -> DhtOp
Create an Op with arbitrary data but that has the given timestamp and location.
Used for bounded range queries based on the PartialOrd impl of the op.
§fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
The quantized space and time coordinates, based on the location and timestamp.
§impl OpRegion<RegionData> for OpData
impl OpRegion<RegionData> for OpData
§fn loc(&self) -> DhtLocation
fn loc(&self) -> DhtLocation
The op’s Location
§fn region_data(&self) -> RegionData
fn region_data(&self) -> RegionData
The RegionData that would be produced if this op were the only op
in the region. The sum of these produces the RegionData for the whole
region.
§fn bound(timestamp: Timestamp, loc: DhtLocation) -> OpData
fn bound(timestamp: Timestamp, loc: DhtLocation) -> OpData
Create an Op with arbitrary data but that has the given timestamp and location.
Used for bounded range queries based on the PartialOrd impl of the op.
§fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
The quantized space and time coordinates, based on the location and timestamp.
§impl PartialEq<RegionData> for RegionData
impl PartialEq<RegionData> for RegionData
§fn eq(&self, other: &RegionData) -> bool
fn eq(&self, other: &RegionData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl RegionDataConstraints for RegionData
impl RegionDataConstraints for RegionData
§impl Serialize for RegionData
impl Serialize for RegionData
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Sub<RegionData> for RegionData
impl Sub<RegionData> for RegionData
§type Output = RegionData
type Output = RegionData
The resulting type after applying the
-
operator.§fn sub(self, other: RegionData) -> <RegionData as Sub<RegionData>>::Output
fn sub(self, other: RegionData) -> <RegionData as Sub<RegionData>>::Output
Performs the
-
operation. Read more§impl SubAssign<RegionData> for RegionData
impl SubAssign<RegionData> for RegionData
§fn sub_assign(&mut self, other: RegionData)
fn sub_assign(&mut self, other: RegionData)
Performs the
-=
operation. Read more§impl Sum<RegionData> for RegionData
impl Sum<RegionData> for RegionData
§fn sum<I>(iter: I) -> RegionDatawhere
I: Iterator<Item = RegionData>,
fn sum<I>(iter: I) -> RegionDatawhere I: Iterator<Item = RegionData>,
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items.§impl Zero for RegionData
impl Zero for RegionData
impl Eq for RegionData
impl StructuralEq for RegionData
impl StructuralPartialEq for RegionData
Auto Trait Implementations§
impl RefUnwindSafe for RegionData
impl Send for RegionData
impl Sync for RegionData
impl Unpin for RegionData
impl UnwindSafe for RegionData
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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<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> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref