pub enum WeakValue {
Reference(Weak<dyn AnyValue>),
Object(WeakRef<FerroObject>, TypeId),
Value(BoxedValue),
}Expand description
A reference to a binding source that does not keep it alive.
Objects of the class hierarchy and registered reference (model) types are held weakly, as the managed implementation holds every source. Plain values (numbers, strings, value structs) own nothing that could form a cycle and exist only as the transient box that carries them, so they are held by value.
Variants§
Reference(Weak<dyn AnyValue>)
A shared model object.
Object(WeakRef<FerroObject>, TypeId)
An object of the class hierarchy and the handle type it was seen as.
Value(BoxedValue)
A plain value.
Implementations§
Source§impl WeakValue
impl WeakValue
pub fn new(value: &BoxedValue) -> Self
Sourcepub fn upgrade(&self) -> Option<BoxedValue>
pub fn upgrade(&self) -> Option<BoxedValue>
The source, if it is still alive.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WeakValue
impl !Send for WeakValue
impl !Sync for WeakValue
impl !UnwindSafe for WeakValue
impl Freeze for WeakValue
impl Unpin for WeakValue
impl UnsafeUnpin for WeakValue
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more