Struct BasicComp

Source
pub struct BasicComp<F, T = BasicState>(/* private fields */);

Implementations§

Source§

impl<F, T> BasicComp<F, T>

Source

pub fn new(f: F) -> Self

Trait Implementations§

Source§

impl<F, T> Component for BasicComp<F, T>
where F: FnMut(KeyEvent, &mut T, Children<'_, '_>, Context<'_, '_, T>) + 'static, T: State,

Source§

type Message = ()

Source§

type State = T

Source§

fn on_key( &mut self, key: KeyEvent, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

const TICKS: bool = true

Source§

fn on_mount( &mut self, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_unmount( &mut self, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_blur( &mut self, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_focus( &mut self, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_mouse( &mut self, mouse: MouseEvent, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_tick( &mut self, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, dt: Duration, )

Source§

fn on_message( &mut self, message: Self::Message, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_resize( &mut self, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn on_event( &mut self, event: &mut UserEvent<'_>, state: &mut Self::State, children: Children<'_, '_>, context: Context<'_, '_, Self::State>, )

Source§

fn accept_focus(&self) -> bool

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<F, T> UnwindSafe for BasicComp<F, T>
where F: UnwindSafe, T: 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> AnyComponent for T
where T: Component + 'static,

Source§

fn any_event( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, event: Event, ) -> Event

Source§

fn any_accept_focus(&self) -> bool

Source§

fn any_ticks(&self) -> bool

Source§

fn any_message( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, message: Box<dyn Any>, )

Source§

fn any_focus( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, )

Source§

fn any_blur( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, )

Source§

fn any_tick( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, dt: Duration, )

Source§

fn any_resize( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, )

Source§

fn any_component_event( &mut self, children: Children<'_, '_>, ctx: AnyComponentContext<'_, '_>, event: &mut UserEvent<'_>, )

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