pub struct ComboboxState {
pub text: String,
/* private fields */
}Expand description
The signals a Combobox keeps: the text, whether its list is open,
which option the arrow keys reached, and whether the pointer is on the
list.
Put one in the page’s signals for each combobox and read the chosen text
from ComboboxState::text.
use hypersig::Signals;
use hypersig_ui::ComboboxState;
use serde::{Deserialize, Serialize};
#[derive(Signals, Serialize, Deserialize)]
struct Form {
country: ComboboxState,
}
let form = Form { country: ComboboxState::new("Japan") };
assert_eq!(form.country.text, "Japan");Fields§
§text: StringWhat the text field holds: what the visitor typed, or the option they chose.
Implementations§
Source§impl ComboboxState
impl ComboboxState
Trait Implementations§
Source§impl Clone for ComboboxState
impl Clone for ComboboxState
Source§fn clone(&self) -> ComboboxState
fn clone(&self) -> ComboboxState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComboboxState
impl Debug for ComboboxState
Source§impl Default for ComboboxState
impl Default for ComboboxState
Source§fn default() -> ComboboxState
fn default() -> ComboboxState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ComboboxState
impl<'de> Deserialize<'de> for ComboboxState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ComboboxState
Source§impl PartialEq for ComboboxState
impl PartialEq for ComboboxState
Source§impl Serialize for ComboboxState
impl Serialize for ComboboxState
impl Signals for ComboboxState
impl StructuralPartialEq for ComboboxState
Auto Trait Implementations§
impl Freeze for ComboboxState
impl RefUnwindSafe for ComboboxState
impl Send for ComboboxState
impl Sync for ComboboxState
impl Unpin for ComboboxState
impl UnsafeUnpin for ComboboxState
impl UnwindSafe for ComboboxState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more