pub enum ListDirError {
NotFound(String),
NotADirectory(String),
PermissionDenied(String),
Io {
path: String,
source: Error,
},
NoHome(String),
}Expand description
Why a list_dir call failed, in distinguishable variants.
Why: the picker reacts differently per cause — a typo’d path is a
recoverable inline message, a permission refusal is an OS-level prompt, an
unexpected IO fault is a bug report. A stringly error would force the client
to substring-match to tell those apart. Each variant maps to a distinct
JSON-RPC code in protocol::to_rpc_error.
What: NotFound/NotADirectory/PermissionDenied are the three
caller-actionable cases; Io is the residual OS fault; NoHome covers a
~ path on a system with no resolvable home directory.
Test: tests::nonexistent_path_is_not_found,
tests::file_path_is_not_a_directory,
tests::unreadable_dir_is_permission_denied.
Variants§
NotFound(String)
The path does not exist.
NotADirectory(String)
The path exists but is a file, not a directory.
PermissionDenied(String)
The OS refused access. tcode inherits the user’s entitlements — this is reported, never worked around (see module docs).
Io
Any other OS-level IO failure.
NoHome(String)
A ~-relative path was given but no home directory could be resolved.
Trait Implementations§
Source§impl Debug for ListDirError
impl Debug for ListDirError
Source§impl Display for ListDirError
impl Display for ListDirError
Source§impl Error for ListDirError
impl Error for ListDirError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for ListDirError
impl !UnwindSafe for ListDirError
impl Freeze for ListDirError
impl Send for ListDirError
impl Sync for ListDirError
impl Unpin for ListDirError
impl UnsafeUnpin for ListDirError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more