Struct Stdio

Source
pub struct Stdio {}
Expand description

The fallback backend using standard input and output.

This backend is intended as a fallback backend to use if no other backend is available. The dialogs are printed to the standard output and user input is read from the standard input.

Implementations§

Source§

impl Stdio

Source

pub fn new() -> Stdio

Creates a new Stdio instance.

Examples found in repository?
examples/backend-stdio.rs (line 8)
7fn main() -> dialog::Result<()> {
8    let backend = backends::Stdio::new();
9
10    dialog::Message::new("This is a message.")
11        .title("And this is a title:")
12        .show_with(&backend)
13}

Trait Implementations§

Source§

impl AsRef<Stdio> for Stdio

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Backend for Stdio

Source§

fn show_input(&self, input: &Input) -> Result<Option<String>>

Shows the given input dialog and returns the input.
Source§

fn show_message(&self, message: &Message) -> Result<()>

Shows the given message dialog.
Source§

fn show_password(&self, password: &Password) -> Result<Option<String>>

Shows the given password dialog and returns the password.
Source§

fn show_question(&self, question: &Question) -> Result<Choice>

Shows the given question dialog and returns the choice.
Source§

fn show_file_selection( &self, file_selection: &FileSelection, ) -> Result<Option<String>>

Shows the given file selection dialog and returns the file name.
Source§

impl Debug for Stdio

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Stdio

Source§

fn default() -> Stdio

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Stdio

§

impl RefUnwindSafe for Stdio

§

impl Send for Stdio

§

impl Sync for Stdio

§

impl Unpin for Stdio

§

impl UnwindSafe for Stdio

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.