Struct undo::Group [−][src]
pub struct Group<K: Hash + Eq, V, S = RandomState> { /* fields omitted */ }
A group of records.
Methods
impl<K: Hash + Eq, V> Group<K, V, RandomState>
[src]
impl<K: Hash + Eq, V> Group<K, V, RandomState>
pub fn new() -> Group<K, V, RandomState>
[src]
pub fn new() -> Group<K, V, RandomState>
Returns a new group.
impl<'a, K: Hash + Eq, V, S: BuildHasher> Group<K, V, S>
[src]
impl<'a, K: Hash + Eq, V, S: BuildHasher> Group<K, V, S>
pub fn builder() -> GroupBuilder<K, V, S>
[src]
pub fn builder() -> GroupBuilder<K, V, S>
Returns a builder for a group.
pub fn reserve(&mut self, additional: usize)
[src]
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more items.
Panics
Panics if the new capacity overflows usize.
pub fn capacity(&self) -> usize
[src]
pub fn capacity(&self) -> usize
Returns the capacity of the group.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of items in the group.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true
if the group is empty.
pub fn set_signals<F>(&mut self, f: F) where
F: FnMut(Option<&K>) + Send + Sync + 'static,
[src]
pub fn set_signals<F>(&mut self, f: F) where
F: FnMut(Option<&K>) + Send + Sync + 'static,
Sets how different signals should be handled when the state changes.
pub fn insert(&mut self, k: K, v: V) -> Option<V>
[src]
pub fn insert(&mut self, k: K, v: V) -> Option<V>
Inserts an item into the group.
pub fn remove(&mut self, k: &K) -> Option<V>
[src]
pub fn remove(&mut self, k: &K) -> Option<V>
Removes an item from the group.
pub fn get(&self) -> Option<&V>
[src]
pub fn get(&self) -> Option<&V>
Gets a reference to the current active item in the group.
pub fn get_mut(&mut self) -> Option<&mut V>
[src]
pub fn get_mut(&mut self) -> Option<&mut V>
Gets a mutable reference to the current active item in the group.
pub fn set(&mut self, k: K) -> Option<K>
[src]
pub fn set(&mut self, k: K) -> Option<K>
Sets the current active item in the group.
Returns None
if the item was successfully set, otherwise k
is returned.
pub fn unset(&mut self)
[src]
pub fn unset(&mut self)
Unsets the current active item in the group.
impl<K: Hash + Eq, R, S: BuildHasher> Group<K, Record<R>, S>
[src]
impl<K: Hash + Eq, R, S: BuildHasher> Group<K, Record<R>, S>
pub fn set_saved(&mut self)
[src]
pub fn set_saved(&mut self)
Calls the set_saved
method on the active record.
pub fn set_unsaved(&mut self)
[src]
pub fn set_unsaved(&mut self)
Calls the set_unsaved
method on the active record.
pub fn is_saved(&self) -> bool
[src]
pub fn is_saved(&self) -> bool
Calls the is_saved
method on the active record.
pub fn apply<C>(
&mut self,
cmd: C
) -> Option<Result<impl Iterator<Item = Box<Command<R> + 'static>>, Error<R>>> where
C: Command<R> + 'static,
R: 'static,
[src]
pub fn apply<C>(
&mut self,
cmd: C
) -> Option<Result<impl Iterator<Item = Box<Command<R> + 'static>>, Error<R>>> where
C: Command<R> + 'static,
R: 'static,
Calls the apply
method on the active record.
pub fn undo(&mut self) -> Option<Result<(), Error<R>>>
[src]
pub fn undo(&mut self) -> Option<Result<(), Error<R>>>
Calls the undo
method on the active record.
pub fn redo(&mut self) -> Option<Result<(), Error<R>>>
[src]
pub fn redo(&mut self) -> Option<Result<(), Error<R>>>
Calls the redo
method on the active record.
pub fn cursor(&self) -> Option<usize>
[src]
pub fn cursor(&self) -> Option<usize>
Calls the cursor
method on the active record.
pub fn set_cursor(&mut self, index: usize) -> Option<Result<(), Error<R>>>
[src]
pub fn set_cursor(&mut self, index: usize) -> Option<Result<(), Error<R>>>
Calls the set_cursor
method on the active record.
pub fn records(
&self
) -> impl Iterator<Item = &Record<R>>
[src]
pub fn records(
&self
) -> impl Iterator<Item = &Record<R>>
Returns an iterator over the records.
Trait Implementations
impl<K: Hash + Eq + Debug, V: Debug, S: BuildHasher> Debug for Group<K, V, S>
[src]
impl<K: Hash + Eq + Debug, V: Debug, S: BuildHasher> Debug for Group<K, V, S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<K: Hash + Eq, V> Default for Group<K, V, RandomState>
[src]
impl<K: Hash + Eq, V> Default for Group<K, V, RandomState>
fn default() -> Group<K, V, RandomState>
[src]
fn default() -> Group<K, V, RandomState>
Returns the "default value" for a type. Read more