pub struct InvalidStateError { /* private fields */ }
Expand description
An error returned when an operation cannot be completed because the state of the underlying struct is inconsistent.
This can be caused by a caller when a sequence of functions is called in a way that results in a state which is inconsistent.
This usually indicates a programming error on behalf of the caller.
Implementations§
Source§impl InvalidStateError
impl InvalidStateError
Sourcepub fn with_message(message: String) -> Self
pub fn with_message(message: String) -> Self
Constructs a new InvalidStateError
with a specified message string.
The implementation of std::fmt::Display
for this error will be the message string
provided.
§Examples
use grid_sdk::error::InvalidStateError;
let invalid_state_error = InvalidStateError::with_message("oops".to_string());
assert_eq!(format!("{}", invalid_state_error), "oops");
Trait Implementations§
Source§impl Debug for InvalidStateError
impl Debug for InvalidStateError
Source§impl Display for InvalidStateError
impl Display for InvalidStateError
Source§impl Error for InvalidStateError
impl Error for InvalidStateError
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()
Auto Trait Implementations§
impl Freeze for InvalidStateError
impl RefUnwindSafe for InvalidStateError
impl Send for InvalidStateError
impl Sync for InvalidStateError
impl Unpin for InvalidStateError
impl UnwindSafe for InvalidStateError
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