Struct yew::services::DialogService[][src]

pub struct DialogService {}
Expand description

A dialog service.

Implementations

impl DialogService[src]

pub fn alert(message: &str)[src]

Calls alert function.

pub fn confirm(message: &str) -> bool[src]

Calls confirm function.

pub fn prompt(message: &str, default: Option<&str>) -> Option<String>[src]

Prompts the user to input a message. In most browsers this will open an alert box with an input field where the user can input a message. A default value can be supplied which will be returned if the user doesn’t input anything.

MDN Documentation

This method will panic! if there is an error in the process of trying to carry out this operation.

Note that this function is blocking; no other code can be run on the thread while the user inputs their message which means that the page will appear to have ‘frozen’ while the user types in their message.

This function will return None if the value of default is None and the user cancels the operation. (normally a ‘cancel’ button will be displayed to the user, clicking which cancels the operation).

Trait Implementations

impl Debug for DialogService[src]

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

Formats the value using the given formatter. Read more

impl Default for DialogService[src]

fn default() -> DialogService[src]

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

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<T> Any for T where
    T: Any
[src]