[−][src]Struct vec_collections::TotalVecMap
A VecMap with default value.
Having a default value means that the mapping is a total function from K to V, hence the name.
Implementations
impl<K, V: Eq, A: Array<Item = (K, V)>> TotalVecMap<V, A>[src]
pub fn new(map: VecMap<A>, default: V) -> Self[src]
Creates a total vec map, given a vec map and a default value.
Mappings in the map that map to the default value will be removed in order to have a unique representation.
impl<K, V, A: Array<Item = (K, V)>> TotalVecMap<V, A>[src]
pub fn constant(value: V) -> Self[src]
Creates a constant mapping from any K to the given V.
pub fn non_default_mappings(&self) -> &VecMap<A>[src]
Returns all non-default mappings as a VecMap<A>.
impl<K: Ord + Clone, V: Eq, A: Array<Item = (K, V)>> TotalVecMap<V, A>[src]
pub fn combine_ref<F: Fn(&V, &V) -> V>(&self, that: &Self, f: F) -> Self[src]
combine a total map with another total map, using a function that takes value references
impl<K: Ord + Clone, V: Ord + Clone, A: Array<Item = (K, V)>> TotalVecMap<V, A>[src]
impl<K: Clone, V: Eq, A: Array<Item = (K, V)>> TotalVecMap<V, A>[src]
pub fn map_values<W: Eq, F: Fn(&V) -> W, B: Array<Item = (K, W)>>(
&self,
f: F
) -> TotalVecMap<W, B>[src]
&self,
f: F
) -> TotalVecMap<W, B>
Trait Implementations
impl<K: Ord + Clone, V: Add<Output = V> + Eq + Clone, A: Array<Item = (K, V)>> Add<TotalVecMap<V, A>> for TotalVecMap<V, A>[src]
type Output = TotalVecMap<V, A>
The resulting type after applying the + operator.
fn add(self, that: Self) -> Self::Output[src]
impl<K, V: Bounded, A: Array<Item = (K, V)>> Bounded for TotalVecMap<V, A>[src]
impl<K: Clone, V: Clone, A: Array<Item = (K, V)>> Clone for TotalVecMap<V, A>[src]
fn clone(&self) -> Self[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<K: Debug, V: Debug, A: Array<Item = (K, V)>> Debug for TotalVecMap<V, A>[src]
impl<K, V: Default, A: Array<Item = (K, V)>> Default for TotalVecMap<V, A>[src]
impl<K: Ord + Clone, V: Div<Output = V> + Eq + Clone, A: Array<Item = (K, V)>> Div<TotalVecMap<V, A>> for TotalVecMap<V, A>[src]
type Output = TotalVecMap<V, A>
The resulting type after applying the / operator.
fn div(self, that: Self) -> Self::Output[src]
impl<K: Eq, V: Eq, A: Array<Item = (K, V)>> Eq for TotalVecMap<V, A>[src]
impl<K, V, A: Array<Item = (K, V)>> From<V> for TotalVecMap<V, A>[src]
Creates a constant mapping from any K to the given V.
impl<K: Hash, V: Hash, A: Array<Item = (K, V)>> Hash for TotalVecMap<V, A>[src]
fn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<K: Ord + 'static, Q: ?Sized, V, A: Array<Item = (K, V)>, '_> Index<&'_ Q> for TotalVecMap<V, A> where
K: Borrow<Q>,
Q: Ord, [src]
K: Borrow<Q>,
Q: Ord,
type Output = V
The returned type after indexing.
fn index(&self, key: &Q) -> &V[src]
Lookup. Time complexity is O(log N), where N is the number of non-default elements
impl<K: Ord + Clone, V: Mul<Output = V> + Eq + Clone, A: Array<Item = (K, V)>> Mul<TotalVecMap<V, A>> for TotalVecMap<V, A>[src]
type Output = TotalVecMap<V, A>
The resulting type after applying the * operator.
fn mul(self, that: Self) -> Self::Output[src]
impl<K: Ord + Clone, V: Neg<Output = V> + Eq + Clone, A: Array<Item = (K, V)>> Neg for TotalVecMap<V, A>[src]
type Output = Self
The resulting type after applying the - operator.
fn neg(self) -> Self::Output[src]
impl<K: Ord + Clone, V: One + Eq + Clone, A: Array<Item = (K, V)>> One for TotalVecMap<V, A>[src]
impl<K: Ord, V: Ord, A: Array<Item = (K, V)>> Ord for TotalVecMap<V, A>[src]
fn cmp(&self, other: &Self) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl<K: PartialEq, V: PartialEq, A: Array<Item = (K, V)>> PartialEq<TotalVecMap<V, A>> for TotalVecMap<V, A>[src]
impl<K: PartialOrd, V: PartialOrd, A: Array<Item = (K, V)>> PartialOrd<TotalVecMap<V, A>> for TotalVecMap<V, A>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<K: Ord + Clone, V: Sub<Output = V> + Eq + Clone, A: Array<Item = (K, V)>> Sub<TotalVecMap<V, A>> for TotalVecMap<V, A>[src]
type Output = Self
The resulting type after applying the - operator.
fn sub(self, that: Self) -> Self::Output[src]
impl<K: Ord + Clone, V: Zero + Eq + Clone, A: Array<Item = (K, V)>> Zero for TotalVecMap<V, A>[src]
Auto Trait Implementations
impl<V, A> RefUnwindSafe for TotalVecMap<V, A> where
A: RefUnwindSafe,
V: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
A: RefUnwindSafe,
V: RefUnwindSafe,
<A as Array>::Item: RefUnwindSafe,
impl<V, A> Send for TotalVecMap<V, A> where
V: Send,
<A as Array>::Item: Send,
V: Send,
<A as Array>::Item: Send,
impl<V, A> Sync for TotalVecMap<V, A> where
A: Sync,
V: Sync,
A: Sync,
V: Sync,
impl<V, A> Unpin for TotalVecMap<V, A> where
A: Unpin,
V: Unpin,
A: Unpin,
V: Unpin,
impl<V, A> UnwindSafe for TotalVecMap<V, A> where
A: UnwindSafe,
V: UnwindSafe,
<A as Array>::Item: RefUnwindSafe,
A: UnwindSafe,
V: UnwindSafe,
<A as Array>::Item: RefUnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<!> for T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
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.
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>,