Struct ca_formats::apgcode::Wechsler[][src]

pub struct Wechsler<'a> { /* fields omitted */ }

A parser for Extended Wechsler format.

Extended Wechsler format is the part of apgcode that encodes the cells in the pattern, e.g. 153 in xq4_153.

As an iterator, it iterates over the living cells.

Reading from files is not supported, since the format is usually short and not stored in a file.

Example

use ca_formats::apgcode::Wechsler;

const GLIDER: &str = "153";

let glider = Wechsler::new(GLIDER);

let cells = glider.map(|cell| cell.unwrap()).collect::<Vec<_>>();
assert_eq!(cells, vec![(0, 0), (1, 0), (1, 2), (2, 0), (2, 1)]);

Implementations

impl<'a> Wechsler<'a>[src]

pub fn new(string: &'a str) -> Self[src]

Creates a new parser instance from a string.

Trait Implementations

impl<'a> Clone for Wechsler<'a>[src]

impl<'a> Debug for Wechsler<'a>[src]

impl<'a> Iterator for Wechsler<'a>[src]

An iterator over living cells in a string in Extended Wechsler format.

type Item = Result<Coordinates, Error>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Wechsler<'a>

impl<'a> Send for Wechsler<'a>

impl<'a> Sync for Wechsler<'a>

impl<'a> Unpin for Wechsler<'a>

impl<'a> UnwindSafe for Wechsler<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.