Enum ActionData
pub enum ActionData {
Value(String),
NumericValue(f64),
ScrollAmount {
direction: ScrollDirection,
amount: f64,
},
TextSelection {
start: u32,
end: u32,
},
}Expand description
Data associated with an action.
Variants§
Value(String)
Text value for SetValue action
NumericValue(f64)
Numeric value for SetValue action
ScrollAmount
Scroll amount and direction
TextSelection
Text selection range (character offsets, 0-based)
Implementations§
§impl ActionData
impl ActionData
pub fn validate(&self, action: Action) -> Result<(), Error>
pub fn validate(&self, action: Action) -> Result<(), Error>
Validate that this ActionData has valid values for the given action.
Checks constraints that are always wrong regardless of element state:
TextSelection:startmust be ≤endNumericValue: must be finite (not NaN or infinity)
Does NOT query the element (e.g., does not check if indices are within text length or if numeric value is within min/max range).
Trait Implementations§
§impl Clone for ActionData
impl Clone for ActionData
§fn clone(&self) -> ActionData
fn clone(&self) -> ActionData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ActionData
impl Debug for ActionData
§impl<'de> Deserialize<'de> for ActionData
impl<'de> Deserialize<'de> for ActionData
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for ActionData
impl Serialize for ActionData
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ActionData
impl RefUnwindSafe for ActionData
impl Send for ActionData
impl Sync for ActionData
impl Unpin for ActionData
impl UnwindSafe for ActionData
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