Struct holochain::prelude::dependencies::kitsune_p2p_types::dht::prelude::RegionSetLtcs
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§
§impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
pub fn empty() -> RegionSetLtcs<D>
pub fn empty() -> RegionSetLtcs<D>
An empty LTCS region set
pub fn from_data(
coords: RegionCoordSetLtcs,
data: Vec<Vec<Vec<D, Global>, Global>, Global>
) -> RegionSetLtcs<D>
pub fn from_data(
coords: RegionCoordSetLtcs,
data: Vec<Vec<Vec<D, Global>, Global>, Global>
) -> RegionSetLtcs<D>
Construct the region set from existing data. The data must match the coords!
pub 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
pub fn diff(
self,
other: RegionSetLtcs<D>
) -> Result<Vec<Region<D>, Global>, GossipError>
pub fn diff(
self,
other: RegionSetLtcs<D>
) -> Result<Vec<Region<D>, Global>, GossipError>
Given two region sets, return only the ones which are different between the two
pub 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.
§impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
impl<D> RegionSetLtcs<D>where
D: RegionDataConstraints,
pub 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§
§impl<D> Clone for RegionSetLtcs<D>where
D: Clone + RegionDataConstraints,
impl<D> Clone for RegionSetLtcs<D>where
D: Clone + RegionDataConstraints,
§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 more§impl<D> Debug for RegionSetLtcs<D>where
D: RegionDataConstraints,
impl<D> Debug for RegionSetLtcs<D>where
D: RegionDataConstraints,
§impl<'de, D> Deserialize<'de> for RegionSetLtcs<D>where
D: RegionDataConstraints + DeserializeOwned,
impl<'de, D> Deserialize<'de> for RegionSetLtcs<D>where
D: RegionDataConstraints + DeserializeOwned,
§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>,
§impl<T> From<RegionSetLtcs<T>> for RegionSet<T>where
T: RegionDataConstraints,
impl<T> From<RegionSetLtcs<T>> for RegionSet<T>where
T: RegionDataConstraints,
§fn from(original: RegionSetLtcs<T>) -> RegionSet<T>
fn from(original: RegionSetLtcs<T>) -> RegionSet<T>
§impl<D> PartialEq<RegionSetLtcs<D>> for RegionSetLtcs<D>where
D: RegionDataConstraints + PartialEq<D>,
impl<D> PartialEq<RegionSetLtcs<D>> for RegionSetLtcs<D>where
D: RegionDataConstraints + PartialEq<D>,
§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 ==
.§impl<D> Serialize for RegionSetLtcs<D>where
D: RegionDataConstraints + Serialize,
impl<D> Serialize for RegionSetLtcs<D>where
D: RegionDataConstraints + Serialize,
§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§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
§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>
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
key
and return true
if they are equal.§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>
self
from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.