[][src]Struct rexpaint::XpLayer

pub struct XpLayer {
    pub width: usize,
    pub height: usize,
    pub cells: Vec<XpCell>,
}

Structure representing a layer Cells are in the same order as in the file, in column-major order (index of position x,y is y*height + x).

Fields

width: usize

Width of layer (in cells)

height: usize

Height of layer (in cells)

cells: Vec<XpCell>

Content of layer

Methods

impl XpLayer[src]

pub fn new(width: usize, height: usize) -> XpLayer[src]

Construct a new XpLayer of width by height. The contents will be empty (black foreground and background, character 0).

pub fn get(&self, x: usize, y: usize) -> Option<&XpCell>[src]

Get the cell at coordinates (x,y), or None if it is out of range.

pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut XpCell>[src]

Get mutable reference to the cell at coordinates (x,y), or None if it is out of range.

Trait Implementations

impl Clone for XpLayer[src]

impl PartialEq<XpLayer> for XpLayer[src]

impl Debug for XpLayer[src]

Auto Trait Implementations

impl Send for XpLayer

impl Sync for XpLayer

impl Unpin for XpLayer

impl UnwindSafe for XpLayer

impl RefUnwindSafe for XpLayer

Blanket Implementations

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

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

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.

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

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

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