pub enum ToastPosition {
TopEnd,
TopStart,
TopCenter,
BottomEnd,
BottomStart,
BottomCenter,
}Expand description
Where the toast stack anchors within the window.
Positions are expressed in logical terms (Start / End) along the
horizontal axis, so they automatically mirror under
crate::LayoutDirection::Rtl without per-application changes — the
same ABDD principle that governs sidebars and header end-controls.
§Choosing a position
TopEnd(default) — top-right under LTR, top-left under RTL. Recommended for application-internal notifications because the bottom half of the window is typically reserved for primary content (previews, editors, lists).BottomEnd— bottom-right under LTR. Matches the OS-level notification center convention on macOS / GNOME / Windows.TopStart/BottomStart— opposite horizontal edges from theEndvariants.TopCenter/BottomCenter— centered horizontally. Useful for modal-feeling messages.
§Stack growth direction
New toasts are inserted so that the most recent toast is closest to the anchor edge:
Top*: new toasts appear below older ones; the newest sits closest to the top edge.Bottom*: new toasts appear above older ones; the newest sits closest to the bottom edge.
The engine is responsible for honoring this invariant; applications
only push to the back of their Vec<Toast<_>> in chronological order.
Variants§
TopEnd
LTR=top-right, RTL=top-left. The default.
TopStart
LTR=top-left, RTL=top-right.
TopCenter
Horizontally centered, anchored to the top edge.
BottomEnd
LTR=bottom-right, RTL=bottom-left.
BottomStart
LTR=bottom-left, RTL=bottom-right.
BottomCenter
Horizontally centered, anchored to the bottom edge.
Implementations§
Trait Implementations§
Source§impl Clone for ToastPosition
impl Clone for ToastPosition
Source§fn clone(&self) -> ToastPosition
fn clone(&self) -> ToastPosition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToastPosition
impl Debug for ToastPosition
Source§impl Default for ToastPosition
impl Default for ToastPosition
Source§fn default() -> ToastPosition
fn default() -> ToastPosition
Source§impl Hash for ToastPosition
impl Hash for ToastPosition
Source§impl PartialEq for ToastPosition
impl PartialEq for ToastPosition
impl Copy for ToastPosition
impl Eq for ToastPosition
impl StructuralPartialEq for ToastPosition
Auto Trait Implementations§
impl Freeze for ToastPosition
impl RefUnwindSafe for ToastPosition
impl Send for ToastPosition
impl Sync for ToastPosition
impl Unpin for ToastPosition
impl UnsafeUnpin for ToastPosition
impl UnwindSafe for ToastPosition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.