pub struct ThemeExtensions { /* private fields */ }Expand description
Type-indexed storage for application-specific theme values.
Implementations§
Source§impl ThemeExtensions
impl ThemeExtensions
Sourcepub fn insert<T>(&mut self, value: T) -> Option<Arc<T>>where
T: ThemeExtension,
pub fn insert<T>(&mut self, value: T) -> Option<Arc<T>>where
T: ThemeExtension,
Insert or replace an extension, returning the previous value when present.
Sourcepub fn get<T>(&self) -> Option<&T>where
T: ThemeExtension,
pub fn get<T>(&self) -> Option<&T>where
T: ThemeExtension,
Borrow an extension by its concrete type.
Sourcepub fn get_arc<T>(&self) -> Option<Arc<T>>where
T: ThemeExtension,
pub fn get_arc<T>(&self) -> Option<Arc<T>>where
T: ThemeExtension,
Clone the shared pointer for an extension by its concrete type.
Sourcepub fn contains<T>(&self) -> boolwhere
T: ThemeExtension,
pub fn contains<T>(&self) -> boolwhere
T: ThemeExtension,
Return whether an extension of type T is registered.
Sourcepub fn remove<T>(&mut self) -> Option<Arc<T>>where
T: ThemeExtension,
pub fn remove<T>(&mut self) -> Option<Arc<T>>where
T: ThemeExtension,
Remove and return an extension by its concrete type.
Trait Implementations§
Source§impl Clone for ThemeExtensions
impl Clone for ThemeExtensions
Source§impl Debug for ThemeExtensions
impl Debug for ThemeExtensions
Auto Trait Implementations§
impl !RefUnwindSafe for ThemeExtensions
impl !UnwindSafe for ThemeExtensions
impl Freeze for ThemeExtensions
impl Send for ThemeExtensions
impl Sync for ThemeExtensions
impl Unpin for ThemeExtensions
impl UnsafeUnpin for ThemeExtensions
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> 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>
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.