[−][src]Struct xwords::crossword::Crossword
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]
contents: String,
width: usize,
height: usize
) -> Result<Crossword, String>
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]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Crossword> for Crossword
[src]
impl StructuralEq for Crossword
[src]
impl StructuralPartialEq for Crossword
[src]
Auto Trait Implementations
impl RefUnwindSafe for Crossword
impl Send for Crossword
impl Sync for Crossword
impl Unpin for Crossword
impl UnwindSafe for Crossword
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash,
T: Hash,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,