[][src]Struct xwords::crossword::Crossword

pub struct Crossword { /* fields omitted */ }

The underlying representation of a crossword puzzle. All of the contents are stored in a string and the dimensions of the grid are stored explicitly.

In the contents, * represents a shaded square, and a represents a blank square.

To parse a square grid, see [xwords::crossword::Crossword::square]. To parse a rectangular grid, see [xwords::crossword::Crossword::rectangle]

Implementations

impl Crossword[src]

pub fn square(contents: String) -> Result<Crossword, String>[src]

Parses a crossword. Assumes that grid width and height are equal and returns an Err if not. Newlines are removed.

pub fn rectangle(
    contents: String,
    width: usize,
    height: usize
) -> Result<Crossword, String>
[src]

Parses a crossword. Assumes that width and height are as specified. If the length of the input does not match the input dimensions, an Err is returned. Newlines are removed.

Trait Implementations

impl Clone for Crossword[src]

impl Debug for Crossword[src]

impl Display for Crossword[src]

impl Eq for Crossword[src]

impl Hash for Crossword[src]

impl PartialEq<Crossword> for Crossword[src]

impl StructuralEq for Crossword[src]

impl StructuralPartialEq for Crossword[src]

Auto Trait Implementations

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> CallHasher for T where
    T: Hash

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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<V, T> VZip<V> for T where
    V: MultiLane<T>,