pub enum PostcodeError {
InvalidInput(String),
NoApiResponse(String),
InvalidApiResponse(String),
InvalidData(String),
TooManyRequests(String),
OtherApiError(String),
}Expand description
Possible errors when fetching an address.
Variants§
InvalidInput(String)
The supplied postcode does not have the correct format: 1234AB or 1234 AB (with one space).
NoApiResponse(String)
The API did not respond to the request.
InvalidApiResponse(String)
The API response body could not be parsed.
InvalidData(String)
The API responded that the inputs are incorrect. This should not happen and instead PostcodeError::InvalidInput should be returned.
TooManyRequests(String)
The API responded with 429 TOO MANY REQUESTS. You’ve exceeded the API limits.
OtherApiError(String)
The API returned an unexpected error code.
Trait Implementations§
Source§impl Debug for PostcodeError
impl Debug for PostcodeError
Source§impl Display for PostcodeError
impl Display for PostcodeError
Source§impl Error for PostcodeError
impl Error for PostcodeError
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 PostcodeError
impl RefUnwindSafe for PostcodeError
impl Send for PostcodeError
impl Sync for PostcodeError
impl Unpin for PostcodeError
impl UnwindSafe for PostcodeError
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