SparseMapVector

Struct SparseMapVector 

Source
pub struct SparseMapVector<R: RingStore> { /* private fields */ }

Implementations§

Source§

impl<R: RingStore> SparseMapVector<R>

Source

pub fn new(len: usize, ring: R) -> Self

Source

pub fn set_len(&mut self, new_len: usize)

Available on crate feature unstable-enable only.
§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn scan<F>(&mut self, f: F)
where F: FnMut(usize, &mut El<R>),

Available on crate feature unstable-enable only.
§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Trait Implementations§

Source§

impl<R: RingStore + Clone> Clone for SparseMapVector<R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: RingStore + Clone> Debug for SparseMapVector<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: RingStore> VectorView<<<R as RingStore>::Type as RingBase>::Element> for SparseMapVector<R>

Source§

fn at(&self, i: usize) -> &El<R>

Source§

fn len(&self) -> usize

Source§

fn specialize_sparse<'a, Op: SparseVectorViewOperation<El<R>>>( &'a self, op: Op, ) -> Result<Op::Output<'a>, ()>

Calls op with self if this vector view supports sparse access. Otherwise, () is returned. Read more
Source§

unsafe fn at_unchecked<'a>(&self, i: usize) -> &T

Returns a refernce to the i-th entry of the vector view, causing UB if i >= self.len(). Read more
Source§

fn as_iter<'a>(&'a self) -> VectorFnIter<VectorViewFn<'a, Self, T>, &'a T>

Returns an iterator over all elements in this vector. Read more
Source§

fn as_fn<'a>(&'a self) -> VectorViewFn<'a, Self, T>

Converts this vector into a VectorFn that yields references &T.
Source§

fn as_slice<'a>(&'a self) -> Option<&'a [T]>
where T: Sized,

If the underlying data of this VectorView can be represented as a slice, returns it. Otherwise, None is returned.
Source§

fn into_clone_ring_els<R: RingStore>( self, ring: R, ) -> CloneElFn<Self, T, CloneRingEl<R>>
where Self: Sized, T: Sized, R::Type: RingBase<Element = T>,

Moves this vector into a VectorFn that clones ring elements on access using the given ring.
Source§

fn clone_ring_els<'a, R: RingStore>( &'a self, ring: R, ) -> CloneElFn<&'a Self, T, CloneRingEl<R>>
where T: Sized, R::Type: RingBase<Element = T>,

Converts this vector into a VectorFn that clones ring elements on access using the given ring.
Source§

fn into_clone_els_by<F>(self, clone_entry: F) -> CloneElFn<Self, T, F>
where Self: Sized, T: Sized, F: Fn(&T) -> T,

Moves this vector into a VectorFn that clones elements on access using the given function.
Source§

fn clone_els_by<'a, F>(&'a self, clone_entry: F) -> CloneElFn<&'a Self, T, F>
where T: Sized, F: Fn(&T) -> T,

Converts this vector into a VectorFn that clones elements on access using the given function.
Source§

fn into_clone_els(self) -> CloneElFn<Self, T, CloneValue>
where Self: Sized, T: Sized + Clone,

Moves this vector into a VectorFn that clones elements on access.
Source§

fn clone_els<'a>(&'a self) -> CloneElFn<&'a Self, T, CloneValue>
where T: Sized + Clone,

Converts this vector into a VectorFn that clones elements on access.
Source§

fn into_copy_els(self) -> CloneElFn<Self, T, CloneValue>
where Self: Sized, T: Sized + Copy,

Moves this vector into a VectorFn that copies elements on access.
Source§

fn copy_els<'a>(&'a self) -> CloneElFn<&'a Self, T, CloneValue>
where T: Sized + Copy,

Converts this vector into a VectorFn that copies elements on access.
Source§

fn map_view<F: for<'a> Fn(&'a T) -> &'a U, U>( self, func: F, ) -> VectorViewMap<Self, T, U, F>
where Self: Sized,

Creates a new VectorView whose elements are the results of the given function applied to the elements of this vector. Read more
Source§

fn step_by_view(self, step_by: usize) -> StepBy<Self, T>
where Self: Sized,

Called step_by_view() to prevent name conflicts with Iterator::step_by().
Source§

impl<R: RingStore> VectorViewMut<<<R as RingStore>::Type as RingBase>::Element> for SparseMapVector<R>

Source§

fn at_mut(&mut self, i: usize) -> &mut El<R>

Source§

fn map_mut<F_const: for<'a> Fn(&'a T) -> &'a U, F_mut: for<'a> FnMut(&'a mut T) -> &'a mut U, U>( self, map_const: F_const, map_mut: F_mut, ) -> VectorViewMapMut<Self, T, U, F_const, F_mut>
where Self: Sized,

Source§

fn as_slice_mut<'a>(&'a mut self) -> Option<&'a mut [T]>
where T: Sized,

If the underlying data of this VectorView can be represented as a slice, returns it. Otherwise, None is returned.
Source§

unsafe fn at_unchecked_mut<'a>(&mut self, i: usize) -> &mut T

Returns a refernce to the i-th entry of the vector view, causing UB if i >= self.len(). Read more
Source§

impl<R: RingStore> VectorViewSparse<<<R as RingStore>::Type as RingBase>::Element> for SparseMapVector<R>

Source§

type Iter<'a> = SparseMapVectorIter<'a, R> where Self: 'a

Source§

fn nontrivial_entries<'a>(&'a self) -> Self::Iter<'a>

Returns an iterator over all elements of the sequence with their indices that are “nonzero” (T must have an appropriate notion of zero). Read more

Auto Trait Implementations§

§

impl<R> Freeze for SparseMapVector<R>
where <<R as RingStore>::Type as RingBase>::Element: Freeze, R: Freeze,

§

impl<R> RefUnwindSafe for SparseMapVector<R>

§

impl<R> Send for SparseMapVector<R>
where <<R as RingStore>::Type as RingBase>::Element: Send, R: Send,

§

impl<R> Sync for SparseMapVector<R>
where <<R as RingStore>::Type as RingBase>::Element: Sync, R: Sync,

§

impl<R> Unpin for SparseMapVector<R>
where <<R as RingStore>::Type as RingBase>::Element: Unpin, R: Unpin,

§

impl<R> UnwindSafe for SparseMapVector<R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.