pub trait ParentData:
Any
+ Debug
+ Display {
// Provided methods
fn detach(&mut self) { ... }
fn provide(&self, id: TypeId) -> Option<&dyn Any> { ... }
fn provide_mut(&mut self, id: TypeId) -> Option<&mut dyn Any> { ... }
}Expand description
Data associated with a child by its parent.
Flutter’s counterpart is the ParentData class. Subclasses are ordinary
Rust types that implement this trait.
Provided Methods§
Sourcefn provide(&self, id: TypeId) -> Option<&dyn Any>
fn provide(&self, id: TypeId) -> Option<&dyn Any>
The half of this parent data whose type is id, if it embeds one.
Dart’s parentData as BoxParentData and parentData is KeepAliveParentDataMixin: a
half answers for its own type, and a type that embeds one answers for its own type first
and then asks the half, so a chain of halves composes. Every box parent must answer
crate::BoxParentData, or a child of it cannot be positioned by the box protocol.
Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".