[][src]Struct smeagol::parse::rle::Rle

pub struct Rle { /* fields omitted */ }

A run-length encoded Life pattern.

Methods

impl Rle[src]

pub fn from_file<P>(path: P) -> Result<Self, Error> where
    P: AsRef<Path>, 
[src]

Loads an RLE pattern from the given file.

Examples

let rle = smeagol::parse::rle::Rle::from_file("./assets/breeder1.rle")?;

pub fn from_file_contents(contents: &[u8]) -> Result<Self, Error>[src]

pub fn from_pattern(pattern_str: &[u8]) -> Result<Self, Error>[src]

Reads an RLE pattern from the given byte array.

Examples

// glider
let rle = smeagol::parse::rle::Rle::from_pattern(b"bob$2bo$3o!")?;

pub fn alive_cells(&self) -> Vec<(u32, u32)>[src]

Returns a Vec containing the coordinates of alive cells in the RLE pattern.

Examples

// glider
let rle = smeagol::parse::rle::Rle::from_pattern(b"bob$2bo$3o!")?;

for (x, y) in rle.alive_cells() {
    // do something
}

Auto Trait Implementations

impl Send for Rle

impl Sync for Rle

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> FromCast for T[src]

impl<T, U> Cast for T where
    U: FromCast<T>, 
[src]