Debian Codegraph @

debian/rust-vendor/xattr/src/error.rs

raw
1 use std::error::Error;
2 use std::fmt;
3
4 /// The error type returned on unsupported platforms.
5 ///
6 /// On unsupported platforms, all operations will fail with an `io::Error` with
7 /// a kind `io::ErrorKind::Unsupported` and an `UnsupportedPlatformError` error as the inner error.
8 /// While you *could* check the inner error, it's probably simpler just to check
9 /// `xattr::SUPPORTED_PLATFORM`.
10 ///
11 /// This error mostly exists for pretty error messages.
12 #[derive(Copy, Clone, Debug)]
13 pub struct UnsupportedPlatformError;
14
15 impl Error for UnsupportedPlatformError {
16 fn description(&self) -> &str {
17 "unsupported platform"
18 }
19 }
20
21 impl fmt::Display for UnsupportedPlatformError {
22 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
23 write!(
24 f,
25 "unsupported platform, please file a bug at `https://github.com/Stebalien/xattr'"
26 )
27 }
28 }