pub struct AdaptationRef { /* private fields */ }Expand description
An Adaptation of any type: what Dart’s Adaptation<Object> in
ThemeData::adaptation_map becomes.
Two refs are equal when they hold the same adaptation, as Dart’s == on an Adaptation
is identity.
Implementations§
Source§impl AdaptationRef
impl AdaptationRef
Sourcepub fn new<T: 'static>(adaptation: impl Adaptation<T>) -> AdaptationRef
pub fn new<T: 'static>(adaptation: impl Adaptation<T>) -> AdaptationRef
Erases adaptation, keyed by its type T.
Sourcepub fn adaptation_type(&self) -> TypeId
pub fn adaptation_type(&self) -> TypeId
The adaptation’s type: Dart’s type, the T of Adaptation<T>.
Sourcepub fn downcast<T: 'static>(&self) -> Option<&dyn Adaptation<T>>
pub fn downcast<T: 'static>(&self) -> Option<&dyn Adaptation<T>>
The adaptation, if its type is T.
Trait Implementations§
Source§impl Clone for AdaptationRef
impl Clone for AdaptationRef
Source§impl Debug for AdaptationRef
impl Debug for AdaptationRef
Source§impl Display for AdaptationRef
impl Display for AdaptationRef
Auto Trait Implementations§
impl !RefUnwindSafe for AdaptationRef
impl !Send for AdaptationRef
impl !Sync for AdaptationRef
impl !UnwindSafe for AdaptationRef
impl Forget for AdaptationRef
impl Freeze for AdaptationRef
impl Move for AdaptationRef
impl Unpin for AdaptationRef
impl UnsafeUnpin for AdaptationRefwhere
*const (): UnsafeUnpin,
*const RcInner<dyn ErasedAdaptation> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ErasedAdaptation>>: UnsafeUnpin,
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