Enum egui::util::id_type_map::Element
source · enum Element {
Value {
value: Box<dyn Any + Send + Sync + 'static>,
clone_fn: fn(_: &Box<dyn Any + Send + Sync + 'static>) -> Box<dyn Any + Send + Sync + 'static>,
},
Serialized(SerializedElement),
}
Variants§
Implementations§
source§impl Element
impl Element
sourcepub(crate) fn new_temp<T: 'static + Any + Clone + Send + Sync>(t: T) -> Self
pub(crate) fn new_temp<T: 'static + Any + Clone + Send + Sync>(t: T) -> Self
Create a value that won’t be persisted.
sourcepub(crate) fn new_persisted<T: SerializableAny>(t: T) -> Self
pub(crate) fn new_persisted<T: SerializableAny>(t: T) -> Self
Create a value that will be persisted.
pub(crate) fn get_temp<T: 'static>(&self) -> Option<&T>
pub(crate) fn get_mut_temp<T: 'static>(&mut self) -> Option<&mut T>
pub(crate) fn get_temp_mut_or_insert_with<T: 'static + Any + Clone + Send + Sync>( &mut self, insert_with: impl FnOnce() -> T, ) -> &mut T
pub(crate) fn get_persisted_mut_or_insert_with<T: SerializableAny>( &mut self, insert_with: impl FnOnce() -> T, ) -> &mut T
pub(crate) fn get_mut_persisted<T: SerializableAny>(&mut self) -> Option<&mut T>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Element
impl !RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl !UnwindSafe for Element
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