pub struct UIResponse {
pub success: bool,
pub message: Option<String>,
pub data: Option<Value>,
pub request_id: Option<u32>,
}Expand description
Represents a response sent from the backend to the frontend after processing an event.
This structure is used to communicate the result of event handling back to the frontend, including success status, optional messages, and data payload.
§Examples
use web_ui::UIResponse;
use serde_json::json;
let response = UIResponse {
success: true,
message: Some("Data saved successfully".to_string()),
data: Some(json!({"id": 42})),
request_id: Some(123),
};Fields§
§success: boolWhether the event was processed successfully
message: Option<String>Optional human-readable message describing the result
data: Option<Value>Optional data payload to send back to the frontend
request_id: Option<u32>Request ID matching the original event request
Trait Implementations§
Source§impl Debug for UIResponse
impl Debug for UIResponse
Source§impl<'de> Deserialize<'de> for UIResponse
impl<'de> Deserialize<'de> for UIResponse
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 UIResponse
impl RefUnwindSafe for UIResponse
impl Send for UIResponse
impl Sync for UIResponse
impl Unpin for UIResponse
impl UnwindSafe for UIResponse
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