[][src]Struct epkard::Runtime

pub struct Runtime<'a, N, F = CliFrontend> where
    N: Node,
    F: Frontend
{ /* fields omitted */ }

Wraps the basic state with extra information and functionality

Methods

impl<'a, N, F> Runtime<'a, N, F> where
    N: Node,
    F: Frontend
[src]

pub fn push<M>(&mut self) -> Interrupt<N> where
    M: Node<State = N::State> + Default
[src]

Push a Node onto the stack using its default

pub fn push_node<M>(&mut self, node: M) -> Interrupt<N> where
    M: Node<State = N::State>, 
[src]

Push a Node onto the stack

pub fn save<P: AsRef<Path>>(&self, path: P) -> RuntimeResult<()> where
    N: Serialize,
    N::State: Serialize
[src]

Save the Runtime to the given path

pub fn load<P: AsRef<Path>>(&mut self, path: P) -> RuntimeResult<()> where
    N: DeserializeOwned,
    N::State: DeserializeOwned
[src]

Load the Runtime from the given path

#[must_use] pub fn prompt<S: Display>(&mut self, prompt: S) -> ControlResult<String, N>[src]

Prompt the user to enter text

#[must_use] pub fn wait(&mut self) -> ControlResult<(), N>[src]

Wait for the user to continue

#[must_use] pub fn multiple_choice<M, C>(
    &mut self,
    message: M,
    choices: &[C]
) -> ControlResult<usize, N> where
    M: Display,
    C: Display
[src]

Prompt the user with multiple choices

#[must_use] pub fn multiple_choice_named<M, S, C, I>(
    &mut self,
    message: M,
    choices: I
) -> ControlResult<C, N> where
    M: Display,
    S: Display,
    I: IntoIterator<Item = (S, C)>, 
[src]

Prompt the user with custom-named multiple choices

Trait Implementations

impl<'a, N, F> Frontend for Runtime<'a, N, F> where
    N: Node,
    F: Frontend
[src]

impl<'a, N, F> AsRef<<N as Node>::State> for Runtime<'a, N, F> where
    N: Node,
    F: Frontend
[src]

impl<'a, N, F> AsMut<<N as Node>::State> for Runtime<'a, N, F> where
    N: Node,
    F: Frontend
[src]

impl<'a, N, F> DerefMut for Runtime<'a, N, F> where
    N: Node,
    F: Frontend
[src]

impl<'a, N, F> Deref for Runtime<'a, N, F> where
    N: Node,
    F: Frontend
[src]

type Target = N::State

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a, N, F = CliFrontend> !Sync for Runtime<'a, N, F>

impl<'a, N, F = CliFrontend> !Send for Runtime<'a, N, F>

impl<'a, N, F> Unpin for Runtime<'a, N, F> where
    F: Unpin,
    N: Unpin,
    <N as Node>::State: Unpin

impl<'a, N, F = CliFrontend> !UnwindSafe for Runtime<'a, N, F>

impl<'a, N, F = CliFrontend> !RefUnwindSafe for Runtime<'a, N, F>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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