[][src]Struct bnc::Data

pub struct Data(_, _);

Pre-computed data for the fast calculation of bulls and cows result.

Methods

impl Data[src]

pub fn new(x: u32) -> Option<Self>[src]

Creates a new Data from the given number.

assert!(bnc::Data::new(0x000000).is_none());
assert!(bnc::Data::new(0x012345).is_some());

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

Returns the number stored in self.

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

pub const fn compare(self, other: Self) -> Result[src]

Compares two Datas, and returns bulls and cows Result.

Trait Implementations

impl Copy for Data[src]

impl Clone for Data[src]

Auto Trait Implementations

impl Unpin for Data

impl Send for Data

impl Sync for Data

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]