[−][src]Struct smeagol::parse::rle::Rle
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]
P: AsRef<Path>,
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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> FromCast for T
[src]
impl<T, U> Cast for T where
U: FromCast<T>,
[src]
U: FromCast<T>,