pub struct RobotError {
pub code: String,
pub message: String,
pub details: Option<String>,
pub suggestion: Option<String>,
}Expand description
Structured error information
Fields§
§code: StringError code (e.g., “E001”)
message: StringHuman-readable message
details: Option<String>Additional details
suggestion: Option<String>Suggested fix
Implementations§
Source§impl RobotError
impl RobotError
Sourcepub fn with_details(self, details: impl Into<String>) -> Self
pub fn with_details(self, details: impl Into<String>) -> Self
Add details
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add suggestion
Sourcepub fn unknown_command(command: &str, suggestions: &[String]) -> Self
pub fn unknown_command(command: &str, suggestions: &[String]) -> Self
Unknown command error
Sourcepub fn invalid_argument(arg: &str, reason: &str) -> Self
pub fn invalid_argument(arg: &str, reason: &str) -> Self
Invalid argument error
Sourcepub fn missing_argument(arg: &str) -> Self
pub fn missing_argument(arg: &str) -> Self
Missing argument error
Sourcepub fn index_not_found(index_name: &str) -> Self
pub fn index_not_found(index_name: &str) -> Self
Index not found error
Sourcepub fn no_results(query: &str) -> Self
pub fn no_results(query: &str) -> Self
No results error
Sourcepub fn network_error(message: &str) -> Self
pub fn network_error(message: &str) -> Self
Network error
Sourcepub fn timeout_error(operation: &str, timeout_ms: u64) -> Self
pub fn timeout_error(operation: &str, timeout_ms: u64) -> Self
Timeout error
Sourcepub fn parse_error(message: &str) -> Self
pub fn parse_error(message: &str) -> Self
Parse error
Trait Implementations§
Source§impl Clone for RobotError
impl Clone for RobotError
Source§fn clone(&self) -> RobotError
fn clone(&self) -> RobotError
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 RobotError
impl Debug for RobotError
Source§impl<'de> Deserialize<'de> for RobotError
impl<'de> Deserialize<'de> for RobotError
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 RobotError
impl RefUnwindSafe for RobotError
impl Send for RobotError
impl Sync for RobotError
impl Unpin for RobotError
impl UnwindSafe for RobotError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more