pub struct UIEvent {
pub element_id: String,
pub event_type: String,
pub data: Value,
pub request_id: Option<u32>,
}Expand description
Represents a UI event sent from the frontend to the backend.
This structure contains all the information needed to identify and handle an event triggered by user interaction in the web interface.
§Examples
use web_ui::UIEvent;
use serde_json::json;
let event = UIEvent {
element_id: "submit-button".to_string(),
event_type: "click".to_string(),
data: json!({"value": "Submit"}),
request_id: Some(123),
};Fields§
§element_id: StringThe unique identifier of the UI element that triggered the event
event_type: StringThe type of event (e.g., “click”, “change”, “submit”)
data: ValueAdditional data associated with the event (e.g., form values, coordinates)
request_id: Option<u32>Optional request ID for matching responses with requests in async scenarios
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UIEvent
impl<'de> Deserialize<'de> for UIEvent
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
Auto Trait Implementations§
impl Freeze for UIEvent
impl RefUnwindSafe for UIEvent
impl Send for UIEvent
impl Sync for UIEvent
impl Unpin for UIEvent
impl UnwindSafe for UIEvent
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