#[non_exhaustive]pub enum ResourceError {
NotFound {
name: String,
kind: ResourceKind,
},
Invalid {
name: String,
message: String,
},
Denied {
name: String,
message: String,
},
Io {
name: String,
error: ErrorKind,
message: String,
},
}Expand description
Why a resource could not be read.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotFound
No resource answers the request.
Invalid
The resource exists but cannot serve the request.
Denied
The provider’s policy or the file system’s permissions refuse the request.
Io
Reading the resource failed for another reason.
Implementations§
Source§impl ResourceError
impl ResourceError
Sourcepub fn not_found(request: &ResourceRequest) -> Self
pub fn not_found(request: &ResourceRequest) -> Self
The error for a request no resource answers.
Sourcepub fn from_io(request: &ResourceRequest, error: &Error) -> Self
pub fn from_io(request: &ResourceRequest, error: &Error) -> Self
The error for a failed read, keeping the kind of the I/O failure.
Trait Implementations§
Source§impl Clone for ResourceError
impl Clone for ResourceError
Source§impl Debug for ResourceError
impl Debug for ResourceError
Source§impl Display for ResourceError
impl Display for ResourceError
impl Eq for ResourceError
Source§impl Error for ResourceError
impl Error for ResourceError
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 PartialEq for ResourceError
impl PartialEq for ResourceError
impl StructuralPartialEq for ResourceError
Auto Trait Implementations§
impl Freeze for ResourceError
impl RefUnwindSafe for ResourceError
impl Send for ResourceError
impl Sync for ResourceError
impl Unpin for ResourceError
impl UnsafeUnpin for ResourceError
impl UnwindSafe for ResourceError
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