[−][src]Struct building_blocks_storage::array::ArrayN
A map from lattice location PointN<N>
to data T
, stored as a flat array on the heap.
Implementations
impl<N, T> ArrayN<N, T>
[src]
pub fn reset_values(&mut self, value: T) where
T: Clone,
[src]
T: Clone,
Set all points to the same value.
pub fn values_slice(&self) -> &[T]
[src]
Returns the entire slice of values.
pub fn into_parts(self) -> (ExtentN<N>, Vec<T>)
[src]
Moves the raw extent and values Vec
out of self
.
pub fn extent(&self) -> &ExtentN<N>
[src]
impl<N, T> ArrayN<N, T> where
ExtentN<N>: IntegerExtent<N>,
[src]
ExtentN<N>: IntegerExtent<N>,
pub fn new(extent: ExtentN<N>, values: Vec<T>) -> Self
[src]
Create a new ArrayN
directly from the extent and values. This asserts that the
number of points in the extent matches the length of the values Vec
.
pub unsafe fn maybe_uninit(extent: ExtentN<N>) -> ArrayN<N, MaybeUninit<T>>
[src]
Creates an uninitialized map, mainly for performance.
Safety
Call assume_init
after manually initializing all of the values.
pub fn fill(extent: ExtentN<N>, value: T) -> Self where
T: Clone,
[src]
T: Clone,
Creates a map that fills the entire extent
with the same value
.
pub fn set_minimum(&mut self, p: PointN<N>)
[src]
Sets the extent minimum to p
.
impl<N, T> ArrayN<N, T> where
PointN<N>: Point,
[src]
PointN<N>: Point,
impl<N, T> ArrayN<N, T> where
PointN<N>: Point,
ExtentN<N>: IntegerExtent<N>,
[src]
PointN<N>: Point,
ExtentN<N>: IntegerExtent<N>,
pub fn fill_with(
extent: ExtentN<N>,
filler: impl FnMut(&PointN<N>) -> T
) -> Self where
ArrayN<N, MaybeUninit<T>>: for<'r> GetMut<&'r PointN<N>, Data = MaybeUninit<T>>,
[src]
extent: ExtentN<N>,
filler: impl FnMut(&PointN<N>) -> T
) -> Self where
ArrayN<N, MaybeUninit<T>>: for<'r> GetMut<&'r PointN<N>, Data = MaybeUninit<T>>,
Create a new array for extent
where each point's value is determined by the filler
function.
pub fn translate(&mut self, p: PointN<N>)
[src]
Adds p
to the extent minimum.
impl<N, T> ArrayN<N, T> where
Self: ForEachMut<N, Stride, Data = T>,
ExtentN<N>: IntegerExtent<N> + PartialEq,
[src]
Self: ForEachMut<N, Stride, Data = T>,
ExtentN<N>: IntegerExtent<N> + PartialEq,
pub fn fill_extent(&mut self, extent: &ExtentN<N>, value: T) where
T: Clone,
[src]
T: Clone,
Fill the entire extent
with the same value
.
impl<N, T> ArrayN<N, MaybeUninit<T>> where
PointN<N>: Point,
ExtentN<N>: IntegerExtent<N>,
[src]
PointN<N>: Point,
ExtentN<N>: IntegerExtent<N>,
pub unsafe fn assume_init(self) -> ArrayN<N, T>
[src]
Transmutes the map values from MaybeUninit<T>
to T
after manual initialization. The
implementation just reconstructs the internal Vec
after transmuting the data pointer, so
the overhead is minimal.
Safety
All elements of the map must be initialized.
Trait Implementations
impl<N, T> Array<N> for ArrayN<N, T> where
N: ArrayIndexer<N>,
[src]
N: ArrayIndexer<N>,
type Indexer = N
fn extent(&self) -> &ExtentN<N>
[src]
fn for_each_point_and_stride(
&self,
extent: &ExtentN<N>,
f: impl FnMut(PointN<N>, Stride)
)
[src]
&self,
extent: &ExtentN<N>,
f: impl FnMut(PointN<N>, Stride)
)
fn stride_from_local_point(&self, p: &Local<N>) -> Stride
[src]
fn strides_from_local_points(&self, points: &[Local<N>], strides: &mut [Stride])
[src]
impl<N: Clone, T: Clone> Clone for ArrayN<N, T>
[src]
impl<N, T> Compressible<FastLz4> for ArrayN<N, T> where
T: Copy,
ExtentN<N>: IntegerExtent<N>,
[src]
T: Copy,
ExtentN<N>: IntegerExtent<N>,
type Compressed = FastLz4CompressedArrayN<N, T>
fn compress(&self, params: FastLz4) -> FastLz4CompressedArrayN<N, T>
[src]
impl<N: Debug, T: Debug> Debug for ArrayN<N, T>
[src]
impl<'de, N, T> Deserialize<'de> for ArrayN<N, T> where
N: Deserialize<'de>,
T: Deserialize<'de>,
[src]
N: Deserialize<'de>,
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<N: Eq, T: Eq> Eq for ArrayN<N, T>
[src]
impl<N, T> ForEach<N, (PointN<N>, Stride)> for ArrayN<N, T> where
Self: Sized + Array<N> + Get<Stride, Data = T> + GetUnchecked<Stride, Data = T>,
[src]
Self: Sized + Array<N> + Get<Stride, Data = T> + GetUnchecked<Stride, Data = T>,
impl<N, T> ForEach<N, PointN<N>> for ArrayN<N, T> where
Self: Sized + Array<N> + Get<Stride, Data = T> + GetUnchecked<Stride, Data = T>,
[src]
Self: Sized + Array<N> + Get<Stride, Data = T> + GetUnchecked<Stride, Data = T>,
impl<N, T> ForEach<N, Stride> for ArrayN<N, T> where
Self: Sized + Array<N> + Get<Stride, Data = T> + GetUnchecked<Stride, Data = T>,
[src]
Self: Sized + Array<N> + Get<Stride, Data = T> + GetUnchecked<Stride, Data = T>,
impl<N, T> ForEachMut<N, (PointN<N>, Stride)> for ArrayN<N, T> where
Self: Sized + Array<N> + GetMut<Stride, Data = T> + GetUncheckedMut<Stride, Data = T>,
ExtentN<N>: Copy,
[src]
Self: Sized + Array<N> + GetMut<Stride, Data = T> + GetUncheckedMut<Stride, Data = T>,
ExtentN<N>: Copy,
type Data = T
fn for_each_mut(
&mut self,
extent: &ExtentN<N>,
f: impl FnMut((PointN<N>, Stride), &mut T)
)
[src]
&mut self,
extent: &ExtentN<N>,
f: impl FnMut((PointN<N>, Stride), &mut T)
)
impl<N, T> ForEachMut<N, PointN<N>> for ArrayN<N, T> where
Self: Sized + Array<N> + GetMut<Stride, Data = T> + GetUncheckedMut<Stride, Data = T>,
ExtentN<N>: Copy,
[src]
Self: Sized + Array<N> + GetMut<Stride, Data = T> + GetUncheckedMut<Stride, Data = T>,
ExtentN<N>: Copy,
type Data = T
fn for_each_mut(
&mut self,
extent: &ExtentN<N>,
f: impl FnMut(PointN<N>, &mut T)
)
[src]
&mut self,
extent: &ExtentN<N>,
f: impl FnMut(PointN<N>, &mut T)
)
impl<N, T> ForEachMut<N, Stride> for ArrayN<N, T> where
Self: Sized + Array<N> + GetMut<Stride, Data = T> + GetUncheckedMut<Stride, Data = T>,
ExtentN<N>: Copy,
[src]
Self: Sized + Array<N> + GetMut<Stride, Data = T> + GetUncheckedMut<Stride, Data = T>,
ExtentN<N>: Copy,
impl<N, T, '_> Get<&'_ Local<N>> for ArrayN<N, T> where
T: Clone,
Self: Array<N> + Get<Stride, Data = T>,
[src]
T: Clone,
Self: Array<N> + Get<Stride, Data = T>,
impl<N, T, '_> Get<&'_ PointN<N>> for ArrayN<N, T> where
T: Clone,
Self: Array<N> + for<'r> Get<&'r Local<N>, Data = T>,
PointN<N>: Point,
[src]
T: Clone,
Self: Array<N> + for<'r> Get<&'r Local<N>, Data = T>,
PointN<N>: Point,
impl<N, T> Get<Stride> for ArrayN<N, T> where
T: Clone,
[src]
T: Clone,
impl<N, T, '_> GetMut<&'_ Local<N>> for ArrayN<N, T> where
Self: Array<N> + GetMut<Stride, Data = T>,
[src]
Self: Array<N> + GetMut<Stride, Data = T>,
impl<N, T, '_> GetMut<&'_ PointN<N>> for ArrayN<N, T> where
Self: Array<N> + for<'r> GetMut<&'r Local<N>, Data = T>,
PointN<N>: Point,
[src]
Self: Array<N> + for<'r> GetMut<&'r Local<N>, Data = T>,
PointN<N>: Point,
impl<N, T> GetMut<Stride> for ArrayN<N, T>
[src]
impl<N, T, '_> GetUnchecked<&'_ Local<N>> for ArrayN<N, T> where
T: Clone,
Self: Array<N> + GetUnchecked<Stride, Data = T>,
[src]
T: Clone,
Self: Array<N> + GetUnchecked<Stride, Data = T>,
type Data = T
unsafe fn get_unchecked(&self, p: &Local<N>) -> Self::Data
[src]
impl<N, T, '_> GetUnchecked<&'_ PointN<N>> for ArrayN<N, T> where
T: Clone,
Self: Array<N> + for<'r> GetUnchecked<&'r Local<N>, Data = T>,
PointN<N>: Point,
[src]
T: Clone,
Self: Array<N> + for<'r> GetUnchecked<&'r Local<N>, Data = T>,
PointN<N>: Point,
type Data = T
unsafe fn get_unchecked(&self, p: &PointN<N>) -> Self::Data
[src]
impl<N, T> GetUnchecked<Stride> for ArrayN<N, T> where
T: Clone,
[src]
T: Clone,
type Data = T
unsafe fn get_unchecked(&self, stride: Stride) -> Self::Data
[src]
impl<N, T, '_> GetUncheckedMut<&'_ Local<N>> for ArrayN<N, T> where
Self: Array<N> + GetUncheckedMut<Stride, Data = T>,
[src]
Self: Array<N> + GetUncheckedMut<Stride, Data = T>,
type Data = T
unsafe fn get_unchecked_mut(&mut self, p: &Local<N>) -> &mut Self::Data
[src]
impl<N, T, '_> GetUncheckedMut<&'_ PointN<N>> for ArrayN<N, T> where
Self: Array<N> + for<'r> GetUncheckedMut<&'r Local<N>, Data = T>,
PointN<N>: Point,
[src]
Self: Array<N> + for<'r> GetUncheckedMut<&'r Local<N>, Data = T>,
PointN<N>: Point,
type Data = T
unsafe fn get_unchecked_mut(&mut self, p: &PointN<N>) -> &mut Self::Data
[src]
impl<N, T> GetUncheckedMut<Stride> for ArrayN<N, T>
[src]
type Data = T
unsafe fn get_unchecked_mut(&mut self, stride: Stride) -> &mut Self::Data
[src]
impl<N: PartialEq, T: PartialEq> PartialEq<ArrayN<N, T>> for ArrayN<N, T>
[src]
impl<'a, N: 'a, T: 'a> ReadExtent<'a, N> for ArrayN<N, T> where
PointN<N>: IntegerPoint,
[src]
PointN<N>: IntegerPoint,
type Src = ArrayCopySrc<&'a ArrayN<N, T>>
type SrcIter = Once<(ExtentN<N>, Self::Src)>
fn read_extent(&'a self, extent: &ExtentN<N>) -> Self::SrcIter
[src]
impl<N, T> Serialize for ArrayN<N, T> where
N: Serialize,
T: Serialize,
[src]
N: Serialize,
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<N, T> StructuralEq for ArrayN<N, T>
[src]
impl<N, T> StructuralPartialEq for ArrayN<N, T>
[src]
impl<'a, N, T> WriteExtent<N, ArrayCopySrc<&'a ArrayN<N, T>>> for ArrayN<N, T> where
Self: Array<N> + GetUncheckedRelease<Stride, T>,
T: Clone,
PointN<N>: IntegerPoint,
ExtentN<N>: Copy,
[src]
Self: Array<N> + GetUncheckedRelease<Stride, T>,
T: Clone,
PointN<N>: IntegerPoint,
ExtentN<N>: Copy,
fn write_extent(
&mut self,
extent: &ExtentN<N>,
src_array: ArrayCopySrc<&'a Self>
)
[src]
&mut self,
extent: &ExtentN<N>,
src_array: ArrayCopySrc<&'a Self>
)
impl<'a, N, T, M, F> WriteExtent<N, ArrayCopySrc<TransformMap<'a, M, F>>> for ArrayN<N, T> where
Self: Array<N>,
T: Clone,
TransformMap<'a, M, F>: Array<N> + GetUncheckedRelease<Stride, T>,
PointN<N>: IntegerPoint,
ExtentN<N>: Copy,
[src]
Self: Array<N>,
T: Clone,
TransformMap<'a, M, F>: Array<N> + GetUncheckedRelease<Stride, T>,
PointN<N>: IntegerPoint,
ExtentN<N>: Copy,
fn write_extent(
&mut self,
extent: &ExtentN<N>,
src_array: ArrayCopySrc<TransformMap<'a, M, F>>
)
[src]
&mut self,
extent: &ExtentN<N>,
src_array: ArrayCopySrc<TransformMap<'a, M, F>>
)
impl<M, N, T> WriteExtent<N, Either<ArrayCopySrc<M>, AmbientExtent<N, T>>> for ArrayN<N, T> where
T: Clone,
Self: Array<N> + WriteExtent<N, ArrayCopySrc<M>>,
ExtentN<N>: Copy + IntegerExtent<N> + PartialEq,
[src]
T: Clone,
Self: Array<N> + WriteExtent<N, ArrayCopySrc<M>>,
ExtentN<N>: Copy + IntegerExtent<N> + PartialEq,
fn write_extent(&mut self, extent: &ExtentN<N>, src: ChunkCopySrc<M, N, T>)
[src]
impl<'a, N, F, T: 'a + Clone> WriteExtent<N, F> for ArrayN<N, T> where
F: Fn(&PointN<N>) -> T,
PointN<N>: IntegerPoint,
ExtentN<N>: IntegerExtent<N>,
ArrayN<N, T>: ForEachMut<N, PointN<N>, Data = T>,
[src]
F: Fn(&PointN<N>) -> T,
PointN<N>: IntegerPoint,
ExtentN<N>: IntegerExtent<N>,
ArrayN<N, T>: ForEachMut<N, PointN<N>, Data = T>,
fn write_extent(&mut self, extent: &ExtentN<N>, src: F)
[src]
Auto Trait Implementations
impl<N, T> RefUnwindSafe for ArrayN<N, T> where
N: RefUnwindSafe,
T: RefUnwindSafe,
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<N, T> Send for ArrayN<N, T> where
N: Send,
T: Send,
N: Send,
T: Send,
impl<N, T> Sync for ArrayN<N, T> where
N: Sync,
T: Sync,
N: Sync,
T: Sync,
impl<N, T> Unpin for ArrayN<N, T> where
N: Unpin,
T: Unpin,
N: Unpin,
T: Unpin,
impl<N, T> UnwindSafe for ArrayN<N, T> where
N: UnwindSafe,
T: UnwindSafe,
N: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Compressible<BincodeLz4> for T where
T: DeserializeOwned + Serialize,
[src]
T: DeserializeOwned + Serialize,
type Compressed = BincodeLz4Compressed<T>
pub fn compress(
&self,
params: BincodeLz4
) -> <T as Compressible<BincodeLz4>>::Compressed
[src]
&self,
params: BincodeLz4
) -> <T as Compressible<BincodeLz4>>::Compressed
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<'a, F, N, T> ForEach<N, PointN<N>> for F where
F: Fn(&PointN<N>) -> T,
PointN<N>: Copy,
ExtentN<N>: IntegerExtent<N>,
[src]
F: Fn(&PointN<N>) -> T,
PointN<N>: Copy,
ExtentN<N>: IntegerExtent<N>,
type Data = T
pub fn for_each(
&Self,
&ExtentN<N>,
impl FnMut(PointN<N>, <F as ForEach<N, PointN<N>>>::Data)
)
[src]
&Self,
&ExtentN<N>,
impl FnMut(PointN<N>, <F as ForEach<N, PointN<N>>>::Data)
)
impl<T> From<T> for T
[src]
impl<F, T, Coord> Get<Coord> for F where
F: Fn(Coord) -> T,
[src]
F: Fn(Coord) -> T,
impl<M, L, T> GetUncheckedMutRelease<L, T> for M where
M: GetMut<L, Data = T> + GetUncheckedMut<L, Data = T>,
[src]
M: GetMut<L, Data = T> + GetUncheckedMut<L, Data = T>,
fn get_unchecked_mut_release(&mut self, location: L) -> &mut T
[src]
impl<M, L, T> GetUncheckedRelease<L, T> for M where
M: Get<L, Data = T> + GetUnchecked<L, Data = T>,
[src]
M: Get<L, Data = T> + GetUnchecked<L, Data = T>,
fn get_unchecked_release(&self, location: L) -> T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, F, N, T> ReadExtent<'a, N> for F where
F: 'a + Fn(&PointN<N>) -> T,
ExtentN<N>: Copy,
PointN<N>: Point,
[src]
F: 'a + Fn(&PointN<N>) -> T,
ExtentN<N>: Copy,
PointN<N>: Point,
type Src = &'a F
type SrcIter = Once<(ExtentN<N>, <F as ReadExtent<'a, N>>::Src)>
pub fn read_extent(&'a Self, &ExtentN<N>) -> <F as ReadExtent<'a, N>>::SrcIter
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,