[][src]Struct bnc::Result

pub struct Result(_);

Bulls and Cows result.

Methods

impl Result[src]

pub const VALUES: [Self; 27][src]

All the possible values of Self.

pub fn new(bulls: u8, cows: u8) -> Option<Self>[src]

Creates a new Result from given numbers of bulls and cows.

assert!(bnc::Result::new(7,0).is_none());
assert!(bnc::Result::new(0,7).is_none());
assert!(bnc::Result::new(4,3).is_none());
assert!(bnc::Result::new(5,1).is_none());
assert!(bnc::Result::new(1,5).is_some());
assert!(bnc::Result::new(0,0).is_some());
assert!(bnc::Result::new(0,6).is_some());
assert!(bnc::Result::new(6,0).is_some());

pub const fn get(self) -> (u8, u8)[src]

Returns the (bulls, cows) of self.

assert_eq!(bnc::Result::new(i,j).unwrap().get(), (i,j));

Trait Implementations

impl Display for Result[src]

impl PartialEq<Result> for Result[src]

impl Eq for Result[src]

impl<T> Index<Result> for ResultArray<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<Result> for ResultArray<T>[src]

impl Copy for Result[src]

impl Clone for Result[src]

Auto Trait Implementations

impl Unpin for Result

impl Send for Result

impl Sync for Result

Blanket Implementations

impl<T> From<T> for T[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> Into<U> for T where
    U: From<T>, 
[src]

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]