Struct Handler

Source
pub struct Handler<T, F> { /* private fields */ }
Expand description

A view that handles events using a provided closure.

Implementations§

Source§

impl<T, F> Handler<T, F>

Source

pub fn new(wrapped: T, handle_event: F) -> Self

Trait Implementations§

Source§

impl<T, F> Bind for Handler<T, F>

Source§

fn bind(&self, context: &Context)

Source§

impl<T: Clone, F: Clone> Clone for Handler<T, F>

Source§

fn clone(&self) -> Handler<T, F>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, F: Debug> Debug for Handler<T, F>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T: PartialEq, F: PartialEq> PartialEq for Handler<T, F>

Source§

fn eq(&self, other: &Handler<T, F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, F> View for Handler<T, F>
where T: View, F: Fn(Event),

Source§

fn fire(&self, event: &Event, event_path: &IdPath, context: &Context)

Source§

fn render(&self, context: &Context) -> Node

Source§

type Body = NeverView

Source§

fn body(&self) -> Self::Body

Source§

impl<T: Eq, F: Eq> Eq for Handler<T, F>

Source§

impl<T, F> StructuralPartialEq for Handler<T, F>

Auto Trait Implementations§

§

impl<T, F> Freeze for Handler<T, F>
where T: Freeze, F: Freeze,

§

impl<T, F> RefUnwindSafe for Handler<T, F>

§

impl<T, F> Send for Handler<T, F>
where T: Send, F: Send,

§

impl<T, F> Sync for Handler<T, F>
where T: Sync, F: Sync,

§

impl<T, F> Unpin for Handler<T, F>
where T: Unpin, F: Unpin,

§

impl<T, F> UnwindSafe for Handler<T, F>
where T: UnwindSafe, F: UnwindSafe,

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IdentifyExt for T

Source§

fn identify(self, id: impl Into<Id>) -> Identified<T>

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> ViewExt for T
where T: View,

Source§

fn modifier(self, modifier: ModifierNode) -> Modified<Self>

Source§

fn gesture<G>(self, gesture: G) -> Gestured<Self, G>
where G: Gesture,

Source§

fn on_taps<F>(self, count: usize, action: F) -> Gestured<Self, TapGesture<F>>
where F: Fn(),

Source§

fn on_tap<F>(self, action: F) -> Gestured<Self, TapGesture<F>>
where F: Fn(),

Source§

fn on_drag_by<F>( self, minimum_distance: impl Into<f64>, action: F, ) -> Gestured<Self, DragGesture<F>>
where F: Fn(&DragEvent),

Source§

fn on_drag<F>(self, action: F) -> Gestured<Self, DragGesture<F>>
where F: Fn(&DragEvent),

Source§

fn overlay_at<O>(self, alignment: Alignment, overlayed: O) -> Overlay<Self, O>
where O: View,

Source§

fn overlay<O>(self, overlayed: O) -> Overlay<Self, O>
where O: View,

Source§

fn padding(self, insets: impl Into<Insets>) -> Modified<Self>

Source§

fn position(self, position: Vec2<f64>) -> Modified<Self>

Source§

fn offset(self, delta: Vec2<f64>) -> Modified<Self>

Source§

fn opacity(self, opacity: impl Into<f64>) -> Modified<Self>

Source§

fn frame_with( self, alignment: Alignment, frame: impl Into<Frame>, ) -> Modified<Self>

Source§

fn frame(self, frame: impl Into<Frame>) -> Modified<Self>

Source§

fn font(self, font: impl Into<Font>) -> Modified<Self>

Source§

fn foreground_style(self, style: impl Into<Style>) -> Modified<Self>

Source§

fn scale_effect_around( self, anchor: UnitPoint, factor: impl Into<f64>, ) -> Modified<Self>

Source§

fn scale_effect(self, factor: impl Into<f64>) -> Modified<Self>

Source§

fn rotation_effect_around( self, anchor: UnitPoint, angle: impl Into<Angle>, ) -> Modified<Self>

Source§

fn rotation_effect(self, angle: impl Into<Angle>) -> Modified<Self>

Source§

fn on_appear(self, action: impl Fn() + 'static) -> Handler<Self, impl Fn(Event)>

Source§

fn on_disappear( self, action: impl Fn() + 'static, ) -> Handler<Self, impl Fn(Event)>