Struct grid_sdk::error::InvalidArgumentError [−][src]
pub struct InvalidArgumentError { /* fields omitted */ }Expand description
An error returned when an argument passed to a function does not conform to the expected format.
This always indicates a programming error on behalf of the caller, since the caller should have verified the argument prior to passing it into the function.
Implementations
Constructs a new InvalidArgumentError with a specified argument and message string.
The argument passed in should be the name of the argument in the function’s signature. The message should be the reason it is invalid, and should not contain the name of the argument (since Display will combine both argument and message).
The implementation of std::fmt::Display for this error will be a combination of the
argument and the message string provided.
Examples
use grid_sdk::error::InvalidArgumentError; let invalid_arg_error = InvalidArgumentError::new("arg1".to_string(), "argument too long".to_string()); assert_eq!(format!("{}", invalid_arg_error), "argument too long (arg1)");
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for InvalidArgumentErrorimpl Send for InvalidArgumentErrorimpl Sync for InvalidArgumentErrorimpl Unpin for InvalidArgumentErrorimpl UnwindSafe for InvalidArgumentError