[][src]Struct sudoku_backend::ops::constraints::SudokuString

pub struct SudokuString<P: StringLength>(pub String, pub PhantomData<P>);

Require that the string be a concise sudoku representation of the specified width.

The error type can be deconstructed as:

Examples

#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct TestLength;

impl StringLength for TestLength {
    const LENGTH: usize = 9;
}

assert_eq!(SudokuString::<TestLength>::from_str("123.76985"),
           Ok(SudokuString("123.76985".to_string(), PhantomData)));

assert!(SudokuString::<TestLength>::from_str("123.7698").is_err());
assert!(SudokuString::<TestLength>::from_str("023.76985").is_err());

Trait Implementations

impl<P: PartialEq + StringLength> PartialEq<SudokuString<P>> for SudokuString<P>
[src]

impl<P: Clone + StringLength> Clone for SudokuString<P>
[src]

Performs copy-assignment from source. Read more

impl<P: Ord + StringLength> Ord for SudokuString<P>
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<P: Eq + StringLength> Eq for SudokuString<P>
[src]

impl<P: PartialOrd + StringLength> PartialOrd<SudokuString<P>> for SudokuString<P>
[src]

impl<P: Debug + StringLength> Debug for SudokuString<P>
[src]

impl<P: StringLength> FromStr for SudokuString<P>
[src]

The associated error which can be returned from parsing.

impl<P: Hash + StringLength> Hash for SudokuString<P>
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<P: StringLength> Serialize for SudokuString<P>
[src]

impl<'de, P: StringLength> Deserialize<'de> for SudokuString<P>
[src]

impl<'v, P: StringLength> FromFormValue<'v> for SudokuString<P>
[src]

The associated error which can be returned from parsing. It is a good idea to have the return type be or contain an &'v str so that the unparseable string can be examined after a bad parse. Read more

Returns a default value to be used when the form field does not exist. If this returns None, then the field is required. Otherwise, this should return Some(default_value). The default implementation simply returns None. Read more

Auto Trait Implementations

impl<P> Send for SudokuString<P> where
    P: Send

impl<P> Sync for SudokuString<P> where
    P: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

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

🔬 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, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Typeable for T where
    T: Any
[src]

Get the TypeId of this object.

impl<T> IntoSql for T
[src]

Convert self to an expression for Diesel's query builder. Read more

Convert &self to an expression for Diesel's query builder. Read more