[−][src]Struct bnc::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]
impl<T> IndexMut<Result> for ResultArray<T>
[src]
impl Copy for Result
[src]
impl Clone for Result
[src]
fn clone(&self) -> Result
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,