Skip to main content

VfError

Enum VfError 

Source
#[non_exhaustive]
pub enum VfError { Op { index: usize, err_no: u32, domain: ErrorDomain, operation: Option<&'static str>, path: Option<PathBuf>, }, OpUnattributed { err_no: u32, domain: ErrorDomain, operation: Option<&'static str>, path: Option<PathBuf>, }, Transport { index: Option<usize>, message: String, operation: Option<&'static str>, path: Option<PathBuf>, }, }
Expand description

The failure of one operation in a vectorized call.

Either a filesystem status failure attributable to a specific operation index, or a transport / client-side failure (where the index is optional because some failures cannot be attributed to one request). An indexed failure does not roll back an already-completed prefix, and a transport failure can make the outcome of an in-flight mutation ambiguous.

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.
§

Op

A filesystem status failure; err_no is errno-style or an NFS4ERR code, mirroring the C tc_res struct.

Fields

§index: usize
§err_no: u32
§operation: Option<&'static str>
§

OpUnattributed

A filesystem / protocol status that cannot be attributed to a specific operation index (for example a compound-level failure with no per-op result). Unlike Op, it does not pretend the failure is operation 0. index_opt reports None.

Fields

§err_no: u32
§operation: Option<&'static str>
§

Transport

A transport / client-side failure with a human-readable message; there is no filesystem status (err_no reports VF_ERR_RPC). index is None when the failure cannot be attributed to any operation.

Fields

§index: Option<usize>
§message: String
§operation: Option<&'static str>

Implementations§

Source§

impl VfError

Source

pub fn failure(index: usize, err_no: u32) -> VfError

Source

pub fn client(index: usize, code: u32) -> VfError

Source

pub fn nfs(index: usize, status: u32) -> VfError

A status returned by an NFS server.

Source

pub fn smb(index: usize, status: u32) -> VfError

A status returned by an SMB server.

Source

pub fn transport( index: impl Into<Option<usize>>, message: impl Into<String>, ) -> VfError

A transport / client-side failure. index is best-effort; pass None when the failure cannot be attributed to a specific operation.

Source

pub fn unsupported(index: usize) -> VfError

Source

pub fn index(&self) -> usize

👎Deprecated:

use index_opt(); an unknown transport location is not request zero

The operation index this error refers to (best-effort for transport failures; 0 when unknown).

Source

pub fn index_opt(&self) -> Option<usize>

The operation index as an Option; None only for a transport failure that cannot be attributed to any operation.

Source

pub fn err_no(&self) -> u32

The filesystem status code, or VF_ERR_RPC for transport failures.

Source

pub fn is_transport(&self) -> bool

Whether this is a transport / client-side failure (no filesystem status).

Source

pub fn from_rpc(e: RpcError, index: impl Into<Option<usize>>) -> VfError

Convert a low-level RpcError into a VfError, attributing the failure to index in the caller’s operation array. index is the caller’s operation index, which may differ from the compound-internal op index; for transport failures the index is best-effort. The transport message (if any) is preserved.

Source

pub fn from_rpc_indexed(e: RpcError) -> VfError

Like from_rpc, but trusts e.op_index as the caller-relative operation index for a server status. Transport errors keep an unknown index because RpcError uses zero only as a wire/API placeholder in that case.

Source

pub fn with_index(self, index: usize) -> VfError

Re-attribute this error to a different operation index.

Source

pub fn map_index(self, map: impl FnOnce(usize) -> usize) -> VfError

Transform a known request index while preserving an unattributable transport failure as None.

Source

pub fn with_context( self, operation: &'static str, path: impl Into<PathBuf>, ) -> VfError

Attach operation and path context without string parsing.

Source

pub fn domain(&self) -> ErrorDomain

Source

pub fn status(&self) -> Option<StatusCode>

Source

pub fn operation(&self) -> Option<&'static str>

Source

pub fn path(&self) -> Option<&Path>

Source§

impl VfError

Source

pub fn failed_item_certainty(&self) -> OutcomeCertainty

Completion certainty for the failed item in a vector operation.

This deliberately says nothing about earlier items in the same vector: VFSI is ordered but non-transactional, so a successful prefix may already have changed filesystem state.

Source

pub fn failed_item_retry_class(&self) -> RetryClass

Retry guidance for the failed item, not for the entire vector call. Retrying a whole mutation vector can repeat its completed prefix.

Source

pub fn certainty(&self) -> OutcomeCertainty

👎Deprecated since 0.2.0:

this describes only the failed item; use failed_item_certainty

Deprecated ambiguous spelling; use Self::failed_item_certainty.

Source

pub fn retry_class(&self) -> RetryClass

👎Deprecated since 0.2.0:

this describes only the failed item; use failed_item_retry_class

Deprecated ambiguous spelling; use Self::failed_item_retry_class.

Trait Implementations§

Source§

impl Clone for VfError

Source§

fn clone(&self) -> VfError

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 VfError

Source§

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

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

impl Display for VfError

Source§

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

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

impl Eq for VfError

Source§

impl Error for VfError

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 PartialEq for VfError

Source§

fn eq(&self, other: &VfError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VfError

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, 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.