pub struct ToastsCell { /* private fields */ }Expand description
常驻 toast 队列的容器。
为什么要包一层:egui_notify::Toasts 没有 Debug,而 UiShared 是 #[derive(Debug)] ——
直接放 Mutex<Option<Toasts>> 编译不过。包一层就能自己决定 Debug 印什么(只印条数,不印内容)。
Implementations§
Source§impl ToastsCell
impl ToastsCell
Sourcepub fn lock(&self) -> MutexGuard<'_, Option<Toasts>>
pub fn lock(&self) -> MutexGuard<'_, Option<Toasts>>
取队列(可能拿到 None = 还没按我们的口径建过)。
Trait Implementations§
Source§impl Debug for ToastsCell
impl Debug for ToastsCell
Auto Trait Implementations§
impl !Freeze for ToastsCell
impl RefUnwindSafe for ToastsCell
impl Send for ToastsCell
impl Sync for ToastsCell
impl Unpin for ToastsCell
impl UnsafeUnpin for ToastsCell
impl UnwindSafe for ToastsCell
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.