pub struct ToggleablePainterRef<P: ToggleablePainter> { /* private fields */ }Expand description
A ToggleablePainter as the CustomPainter a CustomPaint holds: the painter is an
arena object, so the value the widget carries is its handle plus the Listenable the
render object subscribes to (Dart’s painter is its own repaint).
Implementations§
Source§impl<P: ToggleablePainter> ToggleablePainterRef<P>
impl<P: ToggleablePainter> ToggleablePainterRef<P>
Sourcepub fn new(painter: Ref<P>) -> ToggleablePainterRef<P>
pub fn new(painter: Ref<P>) -> ToggleablePainterRef<P>
Wraps a ToggleablePainter as a CustomPainter.
Trait Implementations§
Source§impl<P: ToggleablePainter> CustomPainter for ToggleablePainterRef<P>
impl<P: ToggleablePainter> CustomPainter for ToggleablePainterRef<P>
Source§fn repaint(&self) -> Option<&Rc<dyn Listenable>>
fn repaint(&self) -> Option<&Rc<dyn Listenable>>
The
Listenable that notifies when it is time to repaint. Read moreSource§fn should_repaint(&self, _app: &App, _old_delegate: &dyn CustomPainter) -> bool
fn should_repaint(&self, _app: &App, _old_delegate: &dyn CustomPainter) -> bool
Called whenever a new instance of the custom painter delegate class is
provided to the
RenderCustomPaint object, or any time that a new
CustomPaint object is created with a new instance of the custom painter
delegate class (which amounts to the same thing, because the latter is
implemented in terms of the former). Read moreAuto Trait Implementations§
impl<P> !RefUnwindSafe for ToggleablePainterRef<P>
impl<P> !Send for ToggleablePainterRef<P>
impl<P> !Sync for ToggleablePainterRef<P>
impl<P> !UnwindSafe for ToggleablePainterRef<P>
impl<P> Forget for ToggleablePainterRef<P>
impl<P> Freeze for ToggleablePainterRef<P>where
NonZero<u32>: Freeze,
PhantomData<fn() -> P>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn Listenable> is !null: Freeze,
PhantomData<RcInner<dyn Listenable>>: Freeze,
impl<P> Move for ToggleablePainterRef<P>
impl<P> Unpin for ToggleablePainterRef<P>
impl<P> UnsafeUnpin for ToggleablePainterRef<P>where
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> P>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn Listenable> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Listenable>>: 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