Skip to main content

ToggleablePainterRef

Struct ToggleablePainterRef 

Source
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>

Source

pub fn new(painter: Ref<P>) -> ToggleablePainterRef<P>

Source

pub fn painter(&self) -> Handle<P>

The painter itself.

Trait Implementations§

Source§

impl<P: ToggleablePainter> CustomPainter for ToggleablePainterRef<P>

Source§

fn repaint(&self) -> Option<&Rc<dyn Listenable>>

The Listenable that notifies when it is time to repaint. Read more
Source§

fn paint(&self, app: &mut App, canvas: &mut Canvas, size: Size)

Called whenever the object needs to paint. The given Canvas has its coordinate space configured such that the origin is at the top left of the box. The area of the box is the size of the size argument. Read more
Source§

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 more
Source§

fn as_any(&self) -> &dyn Any

Downcast support for Dart’s runtimeType comparison and covariant parameter.
Source§

fn hit_test(&self, app: &App, position: Offset) -> Option<bool>

Called whenever a hit test is being performed on an object that is using this custom paint delegate. Read more
Source§

impl<P: ToggleablePainter> Debug for ToggleablePainterRef<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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>
where NonZero<u32>: Unpin, Rc<Keep>: Unpin, Rc<dyn Listenable>: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>