Struct actions::Chain [−][src]
pub struct Chain<Action> where
Action: Merge, { /* fields omitted */ }
A chain of actions.
Can be used to store 'macros'.
Methods
impl<Action: Merge> Chain<Action>
[src]
impl<Action: Merge> Chain<Action>
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new chain of actions.
pub fn compress(&mut self)
[src]
pub fn compress(&mut self)
Merges as much actions in the chain as possible.
For example, if the chain contains an action that cancels out the previous action, both of the actions can be removed from the chain.
pub fn push(&mut self, action: Action)
[src]
pub fn push(&mut self, action: Action)
Push an action to the chain.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
The amount of action currently in the chain.
pub fn actions(&self) -> &Vec<Action>
[src]
pub fn actions(&self) -> &Vec<Action>
The actions in the chain.
Trait Implementations
impl<Action: Clone> Clone for Chain<Action> where
Action: Merge,
[src]
impl<Action: Clone> Clone for Chain<Action> where
Action: Merge,
fn clone(&self) -> Chain<Action>
[src]
fn clone(&self) -> Chain<Action>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<Action> From<Vec<Action>> for Chain<Action> where
Action: Merge,
[src]
impl<Action> From<Vec<Action>> for Chain<Action> where
Action: Merge,
impl<Action> Into<Vec<Action>> for Chain<Action> where
Action: Merge,
[src]
impl<Action> Into<Vec<Action>> for Chain<Action> where
Action: Merge,