[−][src]Struct epkard::Runtime
Wraps the basic state with extra information and functionality
Methods
impl<'a, N, F> Runtime<'a, N, F> where
N: Node,
F: Frontend,
[src]
N: Node,
F: Frontend,
pub fn push<M>(&mut self) -> Interrupt<N> where
M: Node<State = N::State> + Default,
[src]
M: Node<State = N::State> + Default,
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]
M: Node<State = N::State>,
Push a Node
onto the stack
pub fn save<P: AsRef<Path>>(&self, path: P) -> RuntimeResult<()> where
N: Serialize,
N::State: Serialize,
[src]
N: Serialize,
N::State: Serialize,
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]
N: DeserializeOwned,
N::State: DeserializeOwned,
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]
&mut self,
message: M,
choices: &[C]
) -> ControlResult<usize, N> where
M: Display,
C: Display,
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]
&mut self,
message: M,
choices: I
) -> ControlResult<C, N> where
M: Display,
S: Display,
I: IntoIterator<Item = (S, C)>,
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]
N: Node,
F: Frontend,
fn background_color(&self) -> Color
[src]
fn set_background_color(&mut self, color: Color)
[src]
fn clear(&mut self)
[src]
fn print_colored<S: ToString>(&mut self, text: S, color: Color)
[src]
fn newline(&mut self)
[src]
fn input(&mut self) -> String
[src]
fn print<S: ToString>(&mut self, text: S)
[src]
fn println<S: ToString>(&mut self, text: S)
[src]
impl<'a, N, F> AsRef<<N as Node>::State> for Runtime<'a, N, F> where
N: Node,
F: Frontend,
[src]
N: Node,
F: Frontend,
impl<'a, N, F> AsMut<<N as Node>::State> for Runtime<'a, N, F> where
N: Node,
F: Frontend,
[src]
N: Node,
F: Frontend,
impl<'a, N, F> DerefMut for Runtime<'a, N, F> where
N: Node,
F: Frontend,
[src]
N: Node,
F: Frontend,
impl<'a, N, F> Deref for Runtime<'a, N, F> where
N: Node,
F: Frontend,
[src]
N: Node,
F: Frontend,
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,
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]
U: From<T>,
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> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,