Struct sea_canal::Pattern
[−]
[src]
pub struct Pattern(_);
A sequence of operations defining a pattern.
Methods
impl Pattern
[src]
fn new(elems: Vec<PatternElem>) -> Self
Constructs a new pattern given a vector of operations.
fn empty() -> Self
Constructs a new empty pattern.
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn extend_each<T>(&self, iter: T) -> Vec<Self> where
T: Iterator<Item = PatternElem>,
T: Iterator<Item = PatternElem>,
Appends each of the items in iter
to the pattern separately, returning a vector of
patterns.
let pat = pat![Plus(3), Mult(2)]; let pats = pat.extend_each(vec![Div(2), Div(3)].into_iter()); assert_eq!(pats, vec![pat![Plus(3), Mult(2), Div(2)], pat![Plus(3), Mult(2), Div(3)]]);
fn iter(&self) -> Iter<PatternElem>
fn has_repeating_types(&self) -> bool
Trait Implementations
impl Clone for Pattern
[src]
fn clone(&self) -> Pattern
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Pattern
[src]
impl Hash for Pattern
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Pattern
[src]
fn eq(&self, __arg_0: &Pattern) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Pattern) -> bool
This method tests for !=
.
impl Eq for Pattern
[src]
impl PartialOrd for Pattern
[src]
fn partial_cmp(&self, __arg_0: &Pattern) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Pattern) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Pattern) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Pattern) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Pattern) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Pattern
[src]
fn cmp(&self, __arg_0: &Pattern) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl IntoIterator for Pattern
[src]
type Item = PatternElem
The type of the elements being iterated over.
type IntoIter = IntoIter<PatternElem>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl FromIterator<PatternElem> for Pattern
[src]
fn from_iter<I: IntoIterator<Item = PatternElem>>(iterator: I) -> Self
Creates a value from an iterator. Read more