pub struct ToastBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct Toast objects.

Implementations§

source§

impl ToastBuilder

source

pub fn action_name(self, action_name: impl Into<GString>) -> Self

The name of the associated action.

It will be activated when clicking the button.

See action-target.

source

pub fn action_target(self, action_target: &Variant) -> Self

The parameter for action invocations.

source

pub fn button_label(self, button_label: impl Into<GString>) -> Self

The label to show on the button.

Underlines in the button text can be used to indicate a mnemonic.

If set to NULL, the button won’t be shown.

See action-name.

source

pub fn custom_title(self, custom_title: &impl IsA<Widget>) -> Self

Available on crate feature v1_2 only.

The custom title widget.

It will be displayed instead of the title if set. In this case, title is ignored.

Setting a custom title will unset title.

source

pub fn priority(self, priority: ToastPriority) -> Self

The priority of the toast.

Priority controls how the toast behaves when another toast is already being displayed.

If the priority is ADW_TOAST_PRIORITY_NORMAL, the toast will be queued.

If the priority is ADW_TOAST_PRIORITY_HIGH, the toast will be displayed immediately, pushing the previous toast into the queue instead.

source

pub fn timeout(self, timeout: u32) -> Self

The timeout of the toast, in seconds.

If timeout is 0, the toast is displayed indefinitely until manually dismissed.

Toasts cannot disappear while being hovered, pressed (on touchscreen), or have keyboard focus inside them.

source

pub fn title(self, title: impl Into<GString>) -> Self

The title of the toast.

The title can be marked up with the Pango text markup language.

Setting a title will unset custom-title.

If custom-title is set, it will be used instead.

source

pub fn use_markup(self, use_markup: bool) -> Self

Available on crate feature v1_4 only.

Whether to use Pango markup for the toast title.

See also parse_markup().

source

pub fn build(self) -> Toast

Build the Toast.

Auto Trait Implementations§

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>,

§

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>,

§

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.