Struct bo::stat::State[][src]

pub struct State<'state, S, A> { /* fields omitted */ }

Implementations

impl<'state, S: 'state + Clone + Copy, A: 'state> State<'state, S, A>[src]

pub fn new<F>(f: F) -> State<'state, S, A> where
    F: Fn(S) -> (S, A) + 'state, 
[src]

pub fn run(&self, s: S) -> (S, A)[src]

pub fn map<B: 'state, G>(self, f: G) -> State<'state, S, B> where
    G: Fn(A) -> B + 'state, 
[src]

pub fn flat_map<B: 'state, G>(self, f: G) -> State<'state, S, B> where
    G: Fn(A) -> State<'state, S, B> + 'state, 
[src]

pub fn get(self) -> State<'state, S, S>[src]

pub fn gets<F>(self, f: F) -> State<'state, S, A> where
    F: Fn(S) -> A + 'state, 
[src]

pub fn put(self, s: S) -> State<'state, S, ()>[src]

pub fn modify<F>(self, f: F) -> State<'state, S, ()> where
    F: Fn(S) -> S + 'state, 
[src]

Auto Trait Implementations

impl<'state, S, A> !RefUnwindSafe for State<'state, S, A>

impl<'state, S, A> !Send for State<'state, S, A>

impl<'state, S, A> !Sync for State<'state, S, A>

impl<'state, S, A> Unpin for State<'state, S, A> where
    A: Unpin,
    S: Unpin

impl<'state, S, A> !UnwindSafe for State<'state, S, A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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.