Skip to main content

ZeroFsError

Enum ZeroFsError 

Source
pub enum ZeroFsError {
Show 16 variants NotFound { path: String, }, PermissionDenied { path: String, }, NotPermitted { path: String, }, AlreadyExists { path: String, }, NotADirectory { path: String, }, IsADirectory { path: String, }, DirectoryNotEmpty { path: String, }, NameTooLong { name: String, }, InvalidArgument { message: String, }, TooManySymlinks { path: String, }, Closed, ConnectFailed { message: String, }, NotLeader { path: String, }, Stale { path: String, }, Io { errno: i32, path: String, message: String, }, Protocol { message: String, },
}
Expand description

Flat, exhaustive error type. New variants require matching updates in zerofs-ffi.

path and name payloads are lossy display strings and are not inputs.

Unclassified server errnos retain their numeric value in ZeroFsError::Io.

Variants§

§

NotFound

No entry at the path (ENOENT).

Fields

§path: String

The path the operation targeted (lossy display).

§

PermissionDenied

Access denied by permission bits (EACCES).

Fields

§path: String

The path the operation targeted (lossy display).

§

NotPermitted

EPERM, distinct from EACCES: the operation requires ownership or privilege (e.g. chown by a non-owner).

Fields

§path: String

The path the operation targeted (lossy display).

§

AlreadyExists

The target already exists (EEXIST).

Fields

§path: String

The path the operation targeted (lossy display).

§

NotADirectory

A path component is not a directory (ENOTDIR).

Fields

§path: String

The path the operation targeted (lossy display).

§

IsADirectory

The target is a directory where a non-directory was required (EISDIR).

Fields

§path: String

The path the operation targeted (lossy display).

§

DirectoryNotEmpty

A directory removal found the directory non-empty (ENOTEMPTY).

Fields

§path: String

The path the operation targeted (lossy display).

§

NameTooLong

Name exceeds 255 bytes.

Fields

§name: String

The offending name (lossy display).

§

InvalidArgument

Bad input detected client-side (e.g. .. component, conflicting open options) or EINVAL from the server.

Fields

§message: String

What was wrong with the input.

Symlink resolution exceeded the 40-hop cap (cycle or pathological chain).

Fields

§path: String

The path whose resolution looped (lossy display).

§

Closed

Handle or client used after close().

§

ConnectFailed

Initial connection, negotiation, or attach failure.

Fields

§message: String

What failed during connect/attach.

§

NotLeader

The target is no longer the HA leader (P9_ENOTLEADER).

Fields

§path: String

The path the operation targeted (lossy display).

§

Stale

Stale handle (ESTALE). From sync methods, prior acknowledged writes may be non-durable and require replacement. Other operations require reopen.

Fields

§path: String

The path the operation targeted (lossy display).

§

Io

Any other server errno, preserved verbatim.

Fields

§errno: i32

The Linux errno the server returned.

§path: String

The path the operation targeted (lossy display).

§message: String

Human-readable rendering of the errno.

§

Protocol

Wire-level failure: codec error, unexpected reply type, failed negotiation.

Fields

§message: String

What went wrong on the wire.

Implementations§

Source§

impl ZeroFsError

Source

pub fn to_errno(&self) -> i32

Linux errno per the strict 1:1 table; Io returns its errno unchanged.

Trait Implementations§

Source§

impl Clone for ZeroFsError

Source§

fn clone(&self) -> ZeroFsError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ZeroFsError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ZeroFsError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ZeroFsError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ZeroFsError> for Error

Lossless conversion for interop with std/tokio I/O: the errno round-trips through from_raw_os_error (so ErrorKind is set), and the original ZeroFsError is preserved as the source (recoverable via downcast).

Source§

fn from(e: ZeroFsError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more