Trait holochain::prelude::dependencies::kitsune_p2p_types::dht::prelude::OpRegion
pub trait OpRegion<D = RegionData>: PartialOrd<Self> + Ord + Send + Sync + Debug {
fn loc(&self) -> DhtLocation;
fn timestamp(&self) -> Timestamp;
fn region_data(&self) -> D;
fn bound(timestamp: Timestamp, loc: DhtLocation) -> Self;
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords { ... }
}
Expand description
Everything that Kitsune needs to know about an Op. Intended to be implemented by the host.
Required Methods
fn loc(&self) -> DhtLocation
fn loc(&self) -> DhtLocation
The op’s Location
fn region_data(&self) -> D
fn region_data(&self) -> D
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) -> Self
fn bound(timestamp: Timestamp, loc: DhtLocation) -> Self
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.
Provided Methods
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
The quantized space and time coordinates, based on the location and timestamp.