Renderer

Struct Renderer 

Source
pub struct Renderer<'a, T> {
    pub on_mount: &'a dyn Fn(&mut T),
    pub on_render: &'a dyn Fn(&mut T),
    pub on_unmount: &'a dyn Fn(&mut T),
    pub on_key_press: &'a dyn Fn(&mut T, KeyEvent),
    pub on_click_left: &'a dyn Fn(&mut T, MouseEvent),
    pub on_click_right: &'a dyn Fn(&mut T, MouseEvent),
}

Fields§

§on_mount: &'a dyn Fn(&mut T)§on_render: &'a dyn Fn(&mut T)§on_unmount: &'a dyn Fn(&mut T)§on_key_press: &'a dyn Fn(&mut T, KeyEvent)§on_click_left: &'a dyn Fn(&mut T, MouseEvent)§on_click_right: &'a dyn Fn(&mut T, MouseEvent)

Implementations§

Source§

impl<'a, T> Renderer<'a, T>

Source

pub fn new( on_mount: &'a dyn Fn(&mut T), on_render: &'a dyn Fn(&mut T), on_unmount: &'a dyn Fn(&mut T), on_key_press: &'a dyn Fn(&mut T, KeyEvent), on_click_left: &'a dyn Fn(&mut T, MouseEvent), on_click_right: &'a dyn Fn(&mut T, MouseEvent), ) -> Self

Trait Implementations§

Source§

impl<T> Default for Renderer<'_, T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a, T> From<OnClickLeft<'a, T>> for Renderer<'a, T>

Source§

fn from(OnClickLeft: OnClickLeft<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<OnClickRight<'a, T>> for Renderer<'a, T>

Source§

fn from(OnClickRight: OnClickRight<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<OnKeyPress<'a, T>> for Renderer<'a, T>

Source§

fn from(OnKeyPress: OnKeyPress<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<OnMount<'a, T>> for Renderer<'a, T>

Source§

fn from(OnMount: OnMount<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<OnRender<'a, T>> for Renderer<'a, T>

Source§

fn from(OnRender: OnRender<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<OnUnmount<'a, T>> for Renderer<'a, T>

Source§

fn from(OnUnmount: OnUnmount<'a, T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, T> Freeze for Renderer<'a, T>

§

impl<'a, T> !RefUnwindSafe for Renderer<'a, T>

§

impl<'a, T> !Send for Renderer<'a, T>

§

impl<'a, T> !Sync for Renderer<'a, T>

§

impl<'a, T> Unpin for Renderer<'a, T>

§

impl<'a, T> !UnwindSafe for Renderer<'a, T>

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
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> 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, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space 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, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more