[−][src]Struct bnc::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 Data
s, and returns bulls and cows Result
.
Trait Implementations
impl Copy for Data
[src]
impl Clone for Data
[src]
fn clone(&self) -> Data
[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,