Skip to main content

LogosIndexMut

Trait LogosIndexMut 

Source
pub trait LogosIndexMut<I>: LogosIndex<I> {
    // Required method
    fn logos_set(&mut self, index: I, value: Self::Output);
}
Expand description

Mutable element access by index.

Provides 1-based mutable indexing for Logos collections.

§Examples

use logicaffeine_data::LogosIndexMut;

let mut v = vec![1, 2, 3];
v.logos_set(2i64, 20);
assert_eq!(v, vec![1, 20, 3]);

§Panics

Panics if the index is less than 1 or greater than the collection length.

Required Methods§

Source

fn logos_set(&mut self, index: I, value: Self::Output)

Set the element at the given index.

Implementations on Foreign Types§

Source§

impl<K: Eq + Hash, V: Clone> LogosIndexMut<K> for HashMap<K, V>

Source§

fn logos_set(&mut self, key: K, value: V)

Source§

impl<T: Clone> LogosIndexMut<i64> for Vec<T>

Source§

fn logos_set(&mut self, index: i64, value: T)

Source§

impl<V: Clone> LogosIndexMut<&str> for HashMap<String, V>

Source§

fn logos_set(&mut self, key: &str, value: V)

Implementors§