Struct kitsune_p2p_dht::region_set::RegionSetLtcs
source · [−]pub struct RegionSetLtcs<D: RegionDataConstraints = RegionData> {
pub coords: RegionCoordSetLtcs,
pub data: Vec<Vec<Vec<D>>>,
/* 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
data: Vec<Vec<Vec<D>>>
The outermost vec corresponds to arqs in the ArqSet; The middle vecs correspond to the spatial segments per arq; the innermost vecs are the time segments per arq.
Implementations
sourceimpl<D: RegionDataConstraints> RegionSetLtcs<D>
impl<D: RegionDataConstraints> RegionSetLtcs<D>
sourcepub fn from_data(coords: RegionCoordSetLtcs, data: Vec<Vec<Vec<D>>>) -> Self
pub fn from_data(coords: RegionCoordSetLtcs, data: Vec<Vec<Vec<D>>>) -> Self
Construct the region set from existing data. The data must match the coords!
sourcepub fn regions(&self) -> impl Iterator<Item = Region<D>> + '_
pub fn regions(&self) -> impl Iterator<Item = Region<D>> + '_
Iterate over each region in the set
sourcepub fn rectify(&mut self, other: &mut Self) -> GossipResult<()>
pub fn rectify(&mut self, other: &mut Self) -> GossipResult<()>
Reshape the two region sets so that both match, omitting or merging regions as needed
sourcepub fn diff(self, other: Self) -> GossipResult<Vec<Region<D>>>
pub fn diff(self, other: Self) -> GossipResult<Vec<Region<D>>>
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.
sourceimpl<D: RegionDataConstraints> RegionSetLtcs<D>
impl<D: RegionDataConstraints> RegionSetLtcs<D>
sourcepub fn from_store<O: OpRegion<D>, S: AccessOpStore<O, D>>(
store: &S,
coords: RegionCoordSetLtcs
) -> Self
pub fn from_store<O: OpRegion<D>, S: AccessOpStore<O, D>>(
store: &S,
coords: RegionCoordSetLtcs
) -> Self
Query the specified OpStore for each coord in the set, constructing the full RegionSet. Purely for convenience.
Trait Implementations
sourceimpl<D: Clone + RegionDataConstraints> Clone for RegionSetLtcs<D>
impl<D: Clone + RegionDataConstraints> Clone for RegionSetLtcs<D>
sourcefn clone(&self) -> RegionSetLtcs<D>
fn clone(&self) -> RegionSetLtcs<D>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<D: RegionDataConstraints> Debug for RegionSetLtcs<D>
impl<D: RegionDataConstraints> Debug for RegionSetLtcs<D>
sourceimpl<'de, D: RegionDataConstraints> Deserialize<'de> for RegionSetLtcs<D>where
D: DeserializeOwned,
impl<'de, D: RegionDataConstraints> Deserialize<'de> for RegionSetLtcs<D>where
D: DeserializeOwned,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl<T: RegionDataConstraints> From<RegionSetLtcs<T>> for RegionSet<T>
impl<T: RegionDataConstraints> From<RegionSetLtcs<T>> for RegionSet<T>
sourcefn from(original: RegionSetLtcs<T>) -> RegionSet<T>
fn from(original: RegionSetLtcs<T>) -> RegionSet<T>
sourceimpl<D: RegionDataConstraints> PartialEq<RegionSetLtcs<D>> for RegionSetLtcs<D>where
D: PartialEq,
impl<D: RegionDataConstraints> PartialEq<RegionSetLtcs<D>> for RegionSetLtcs<D>where
D: PartialEq,
sourceimpl<D: RegionDataConstraints> Serialize for RegionSetLtcs<D>where
D: Serialize,
impl<D: RegionDataConstraints> Serialize for RegionSetLtcs<D>where
D: Serialize,
impl<D: RegionDataConstraints> Eq for RegionSetLtcs<D>where
D: 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 morefn 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.