Struct FormHandle

Source
pub struct FormHandle<'a, T>
where T: Default + Clone + 'static,
{ /* private fields */ }

Implementations§

Source§

impl<'a, T> FormHandle<'a, T>
where T: Default + Clone + 'static,

Source

pub fn state(&self) -> &T

Current form state.

Source

pub fn set<E: 'static>(&self, f: impl FnOnce(&mut T) + 'static) -> Callback<E>

Callback that sets state, ignoring callback event.

Source

pub fn set_with<E: 'static>( &self, f: impl FnOnce(&mut T, E) + 'static, ) -> Callback<E>

Callback that sets state from callback event

Source

pub fn set_text( &self, f: impl FnOnce(&mut T, String) + 'static, ) -> Callback<InputData>

Callback for setting state from InputData.

Source

pub fn set_select( &self, f: impl FnOnce(&mut T, String) + 'static, ) -> Callback<ChangeData>

Callback for setting state from select elements.

§Panics

Panics if used on anything other than a select element.

Source

pub fn set_file( &self, f: impl FnOnce(&mut T, FileData) + Copy + 'static, ) -> Callback<ChangeData>

Callback for setting files

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

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

impl<T> Any for T
where T: Any,