pub struct VldTauriError {
pub error: String,
pub issues: Vec<TauriIssue>,
}Expand description
Serializable error type for Tauri IPC commands, events, and channel messages.
Tauri requires command error types to implement Serialize.
VldTauriError serialises as:
{
"error": "Validation failed",
"issues": [
{ "path": ".name", "message": "String must be at least 2 characters" }
]
}Fields§
§error: StringError category string (e.g. "Validation failed", "Invalid JSON").
issues: Vec<TauriIssue>List of individual validation issues.
Implementations§
Source§impl VldTauriError
impl VldTauriError
Sourcepub fn json_parse_error(msg: impl Display) -> Self
pub fn json_parse_error(msg: impl Display) -> Self
Build a JSON-parse error.
Sourcepub fn custom(error: impl Into<String>, message: impl Into<String>) -> Self
pub fn custom(error: impl Into<String>, message: impl Into<String>) -> Self
Build a generic error with a custom category.
Sourcepub fn has_issues(&self) -> bool
pub fn has_issues(&self) -> bool
true if the error contains any issues.
Sourcepub fn issue_count(&self) -> usize
pub fn issue_count(&self) -> usize
Number of issues.
Trait Implementations§
Source§impl Clone for VldTauriError
impl Clone for VldTauriError
Source§fn clone(&self) -> VldTauriError
fn clone(&self) -> VldTauriError
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 moreSource§impl Debug for VldTauriError
impl Debug for VldTauriError
Source§impl<'de> Deserialize<'de> for VldTauriError
impl<'de> Deserialize<'de> for VldTauriError
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
Source§impl Display for VldTauriError
impl Display for VldTauriError
Source§impl Error for VldTauriError
impl Error for VldTauriError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<VldError> for VldTauriError
impl From<VldError> for VldTauriError
Auto Trait Implementations§
impl Freeze for VldTauriError
impl RefUnwindSafe for VldTauriError
impl Send for VldTauriError
impl Sync for VldTauriError
impl Unpin for VldTauriError
impl UnsafeUnpin for VldTauriError
impl UnwindSafe for VldTauriError
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