pub struct AnyRestorableProperty { /* private fields */ }Expand description
Erased RestorableProperty: one identity and a static vtable, the fat pointer rustc
cannot build for an arena id. No lease.
This is what Dart’s RestorableProperty<Object?> becomes — the type a RestorationMixin
keeps its registered properties as. The property itself stays in the App under its own
type, and downcast gets the typed handle back.
Equality is Dart’s == on an object reference: two handles are equal exactly when they address
the same property.
Implementations§
Source§impl AnyRestorableProperty
impl AnyRestorableProperty
Sourcepub fn upgrade(self, app: &App) -> Option<Retained<AnyRestorableProperty>>
pub fn upgrade(self, app: &App) -> Option<Retained<AnyRestorableProperty>>
A reference while something still keeps the object, None once it is freed or
its last keeper has let go; see Handle::upgrade.
Sourcepub fn keep(self, app: &App) -> Retained<AnyRestorableProperty>
pub fn keep(self, app: &App) -> Retained<AnyRestorableProperty>
A reference to an object something is known to keep; see
Handle::keep.
Source§impl AnyRestorableProperty
impl AnyRestorableProperty
Sourcepub fn downcast<T: 'static>(self, app: &App) -> Option<Handle<T>>
pub fn downcast<T: 'static>(self, app: &App) -> Option<Handle<T>>
Dart’s property as T: the typed handle when this property is a T, else None.
Sourcepub fn restoration_id(self, app: &App) -> Option<&str>
pub fn restoration_id(self, app: &App) -> Option<&str>
The ID under which the property is registered with its owner.
Sourcepub fn owner(self, app: &App) -> Option<AnyRestorationMixin>
pub fn owner(self, app: &App) -> Option<AnyRestorationMixin>
The RestorationMixin this property is registered with; Dart’s _owner.
Sourcepub fn is_registered(self, app: &App) -> bool
pub fn is_registered(self, app: &App) -> bool
Sourcepub fn disposed(self, app: &App) -> bool
pub fn disposed(self, app: &App) -> bool
Whether RestorableProperty::dispose has run.
Sourcepub fn to_primitives(self, app: &App) -> RestorationData
pub fn to_primitives(self, app: &App) -> RestorationData
Sourcepub fn restore(self, app: &mut App, data: Option<&RestorationData>)
pub fn restore(self, app: &mut App, data: Option<&RestorationData>)
Dart’s property.initWithValue(data != null ? property.fromPrimitives(data) : property.createDefaultValue()).
None is Dart’s “no serialized value for this property”; a stored
RestorationData::Null arrives as Some.
Sourcepub fn add_listener(self, app: &mut App, listener: Listener)
pub fn add_listener(self, app: &mut App, listener: Listener)
Sourcepub fn remove_listener(self, app: &mut App, listener: &Listener)
pub fn remove_listener(self, app: &mut App, listener: &Listener)
Trait Implementations§
Source§impl Clone for AnyRestorableProperty
impl Clone for AnyRestorableProperty
impl Copy for AnyRestorableProperty
Source§impl Debug for AnyRestorableProperty
impl Debug for AnyRestorableProperty
impl Eq for AnyRestorableProperty
Source§impl From<AnyRestorableProperty> for HandleId
impl From<AnyRestorableProperty> for HandleId
Source§fn from(handle: AnyRestorableProperty) -> HandleId
fn from(handle: AnyRestorableProperty) -> HandleId
Source§impl<Leaf: RestorableProperty> From<Handle<Leaf>> for AnyRestorableProperty
impl<Leaf: RestorableProperty> From<Handle<Leaf>> for AnyRestorableProperty
Source§fn from(handle: Handle<Leaf>) -> AnyRestorableProperty
fn from(handle: Handle<Leaf>) -> AnyRestorableProperty
Source§impl Hash for AnyRestorableProperty
impl Hash for AnyRestorableProperty
Source§impl PartialEq for AnyRestorableProperty
impl PartialEq for AnyRestorableProperty
Auto Trait Implementations§
impl Forget for AnyRestorableProperty
impl Freeze for AnyRestorableProperty
impl Move for AnyRestorableProperty
impl RefUnwindSafe for AnyRestorableProperty
impl Send for AnyRestorableProperty
impl Sync for AnyRestorableProperty
impl Unpin for AnyRestorableProperty
impl UnsafeUnpin for AnyRestorablePropertywhere
NonZeroU32Inner: UnsafeUnpin,
&'static RestorablePropertyVTable: UnsafeUnpin,
impl UnwindSafe for AnyRestorableProperty
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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
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<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.