[][src]Struct eight_ball::EightBall

pub struct EightBall {
    pub answers: Vec<Answer>,
}

The crate's entry point, holdding the current possible answers

Fields

answers: Vec<Answer>

Methods

impl EightBall[src]

pub fn new() -> Self[src]

Constructs a new EightBall, the possibe answers are matching the original answers

pub fn with_answers(answers: Vec<Answer>) -> Self[src]

Sets the possible answers the crate can return, this allows for custom answers

pub fn ask(&self, _question: &str) -> Option<Answer>[src]

Asks the magic ball a question returns a possible answer randomly it picks a random answer from the possible ones

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,