Struct holochain::prelude::dependencies::kitsune_p2p_types::dht::prelude::RegionSetLtcs
source · pub struct RegionSetLtcs<D = RegionData>where
D: RegionDataConstraints,{
pub coords: RegionCoordSetLtcs,
/* private fields */
}
Expand description
Implementation for the compact LTCS region set format which gets sent over the wire. The coordinates for the regions are specified by a few values. The data to match the coordinates are specified in a 2D vector which must correspond to the generated coordinates.
Fields§
§coords: RegionCoordSetLtcs
The generator for the coordinates
Implementations§
source§impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
sourcepub fn empty() -> RegionSetLtcs<D>
pub fn empty() -> RegionSetLtcs<D>
An empty LTCS region set
sourcepub fn from_data(
coords: RegionCoordSetLtcs,
data: Vec<Vec<Vec<D>>>
) -> RegionSetLtcs<D>
pub fn from_data( coords: RegionCoordSetLtcs, data: Vec<Vec<Vec<D>>> ) -> RegionSetLtcs<D>
Construct the region set from existing data. The data must match the coords!
sourcepub fn rectify(
&mut self,
other: &mut RegionSetLtcs<D>
) -> Result<(), GossipError>
pub fn rectify( &mut self, other: &mut RegionSetLtcs<D> ) -> Result<(), GossipError>
Reshape the two region sets so that both match, omitting or merging regions as needed
sourcepub fn diff(
self,
other: RegionSetLtcs<D>
) -> Result<Vec<Region<D>>, GossipError>
pub fn diff( self, other: RegionSetLtcs<D> ) -> Result<Vec<Region<D>>, GossipError>
Given two region sets, return only the ones which are different between the two
sourcepub fn nonzero_regions(
&self
) -> impl Iterator<Item = ((usize, usize, usize), RegionCoords, D)>
pub fn nonzero_regions( &self ) -> impl Iterator<Item = ((usize, usize, usize), RegionCoords, D)>
Return only the regions which have ops in them. Useful for testing sparse scenarios.
source§impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
sourcepub fn from_store<O, S>(
store: &S,
coords: RegionCoordSetLtcs
) -> RegionSetLtcs<D>where
O: OpRegion<D>,
S: AccessOpStore<O, D>,
pub fn from_store<O, S>(
store: &S,
coords: RegionCoordSetLtcs
) -> RegionSetLtcs<D>where
O: OpRegion<D>,
S: AccessOpStore<O, D>,
Query the specified OpStore for each coord in the set, constructing the full RegionSet. Purely for convenience.
Trait Implementations§
source§impl<D> Clone for RegionSetLtcs<D>where
D: Clone + RegionDataConstraints,
impl<D> Clone for RegionSetLtcs<D>where
D: Clone + RegionDataConstraints,
source§fn clone(&self) -> RegionSetLtcs<D>
fn clone(&self) -> RegionSetLtcs<D>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<D> Debug for RegionSetLtcs<D>where
D: RegionDataConstraints,
impl<D> Debug for RegionSetLtcs<D>where
D: RegionDataConstraints,
source§impl<'de, D> Deserialize<'de> for RegionSetLtcs<D>where
D: RegionDataConstraints + DeserializeOwned,
impl<'de, D> Deserialize<'de> for RegionSetLtcs<D>where
D: RegionDataConstraints + DeserializeOwned,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<RegionSetLtcs<D>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<RegionSetLtcs<D>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl<T> From<RegionSetLtcs<T>> for RegionSet<T>where
T: RegionDataConstraints,
impl<T> From<RegionSetLtcs<T>> for RegionSet<T>where
T: RegionDataConstraints,
source§fn from(original: RegionSetLtcs<T>) -> RegionSet<T>
fn from(original: RegionSetLtcs<T>) -> RegionSet<T>
source§impl<D> PartialEq for RegionSetLtcs<D>where
D: RegionDataConstraints + PartialEq,
impl<D> PartialEq for RegionSetLtcs<D>where
D: RegionDataConstraints + PartialEq,
source§fn eq(&self, other: &RegionSetLtcs<D>) -> bool
fn eq(&self, other: &RegionSetLtcs<D>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<D> Serialize for RegionSetLtcs<D>where
D: RegionDataConstraints + Serialize,
impl<D> Serialize for RegionSetLtcs<D>where
D: RegionDataConstraints + Serialize,
source§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,
impl<D> Eq for RegionSetLtcs<D>where
D: RegionDataConstraints + Eq,
Auto Trait Implementations§
impl<D> RefUnwindSafe for RegionSetLtcs<D>where
D: RefUnwindSafe,
impl<D> Send for RegionSetLtcs<D>
impl<D> Sync for RegionSetLtcs<D>
impl<D> Unpin for RegionSetLtcs<D>where
D: Unpin,
impl<D> UnwindSafe for RegionSetLtcs<D>where
D: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key
and return true
if they are equal.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
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§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> ⓘ
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
source§impl<T> Pointable for T
impl<T> Pointable for T
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>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.