Struct redo::Group
[−]
[src]
pub struct Group<'a, K: Hash + Eq, V, S = RandomState> where
S: BuildHasher, { /* fields omitted */ }
A group of either stacks or records.
Methods
impl<'a, K: Hash + Eq, V> Group<'a, K, V, RandomState>
[src]
pub fn new() -> Group<'a, K, V, RandomState>
[src]
Returns a new group.
impl<'a, K: Hash + Eq, V, S: BuildHasher> Group<'a, K, V, S>
[src]
pub fn builder() -> GroupBuilder<'a, K, V, S>
[src]
Returns a builder for a group.
pub fn capacity(&self) -> usize
[src]
Returns the capacity of the group.
pub fn len(&self) -> usize
[src]
Returns the number of items in the group.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the group is empty.
pub fn insert(&mut self, k: K, v: V) -> Option<V>
[src]
Inserts an item into the group.
pub fn remove(&mut self, k: &K) -> Option<V>
[src]
Removes an item from the group.
pub fn get(&self) -> Option<&V>
[src]
Gets a reference to the current active item in the group.
pub fn get_mut(&mut self) -> Option<&mut V>
[src]
Gets a mutable reference to the current active item in the group.
pub fn set(&mut self, k: K) -> Option<K>
[src]
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]
Unsets the current active item in the group.
impl<'a, K: Hash + Eq, R, C: Command<R>, S: BuildHasher> Group<'a, K, Stack<R, C>, S>
[src]
pub fn push(&mut self, cmd: C) -> Option<Result<(), Error<R, C>>>
[src]
Calls the push
method on the active stack.
pub fn pop(&mut self) -> Option<Result<C, Error<R, C>>>
[src]
Calls the pop
method on the active stack.
impl<'a, K: Hash + Eq, R, C: Command<R>, S: BuildHasher> Group<'a, K, Record<'a, R, C>, S>
[src]
pub fn set_saved(&mut self) -> Option<()>
[src]
Calls the set_saved
method on the active record.
pub fn set_unsaved(&mut self) -> Option<()>
[src]
Calls the set_unsaved
method on the active record.
pub fn is_saved(&self) -> Option<bool>
[src]
Calls the is_saved
method on the active record.
pub fn exec(&mut self, cmd: C) -> Option<Result<Commands<C>, Error<R, C>>>
[src]
Calls the exec
method on the active record.
pub fn undo(&mut self) -> Option<Result<(), C::Err>>
[src]
Calls the undo
method on the active record.
pub fn redo(&mut self) -> Option<Result<(), C::Err>>
[src]
Calls the redo
method on the active record.
impl<'a, K: Hash + Eq, R, C: Command<R> + ToString, S: BuildHasher> Group<'a, K, Record<'a, R, C>, S>
[src]
pub fn to_undo_string(&self) -> Option<String>
[src]
Calls the to_undo_string
method on the active record.
pub fn to_redo_string(&self) -> Option<String>
[src]
Calls the to_redo_string
method on the active record.
Trait Implementations
impl<'a, K: Hash + Eq + Debug, V: Debug, S: BuildHasher> Debug for Group<'a, K, V, S>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a, K: Hash + Eq + Display, V: Display, S: BuildHasher> Display for Group<'a, K, V, S>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a, K: Hash + Eq, V> Default for Group<'a, K, V, RandomState>
[src]
fn default() -> Group<'a, K, V, RandomState>
[src]
Returns the "default value" for a type. Read more