Skip to main content

VfError

Struct VfError 

Source
pub struct VfError { /* private fields */ }
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.

Construct errors through the typed factories and inspect them through methods; status domains and transport provenance cannot be modified independently.

ⓘ
let mut error = vfsi_core::VfError::failure(0, 2);
error.index = Some(9);

Implementations§

Source§

impl VfError

Source

pub fn from_status(index: impl Into<Option<usize>>, status: StatusCode) -> Self

A typed status, with an optional logical request index.

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 transport_with_kind( index: impl Into<Option<usize>>, kind: TransportKind, message: impl Into<String>, ) -> VfError

Source

pub fn unsupported(index: usize) -> VfError

Source

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

Logical request index, or None when a failure cannot be attributed. An index is not a completion boundary: this item can itself contain completed chunks, and other requests can already have changed state.

Source

pub fn raw_code(&self) -> u32

Raw code in the error’s status domain, or VF_ERR_RPC for transport. Application code should use kind or typed status, not compare this value to errno constants.

Source

pub fn is_transport(&self) -> bool

Whether this is a transport failure with no filesystem status.

Source

pub fn transport_kind(&self) -> Option<TransportKind>

Transport provenance only; this never authorizes mutation replay.

Source

pub fn transport_message(&self) -> Option<&str>

The backend’s transport diagnostic, without formatted index/path context.

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 failure as None.

Source

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

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 kind(&self) -> ErrorKind

Portable category; Self::status retains the original status.

This is deliberately not retry guidance. Even a semantic failure can follow successful chunks of the same logical mutation. Reconcile state before replaying a mutation unless its idempotence is established.

Trait Implementations§

Source§

impl Clone for VfError

Source§

fn clone(&self) -> Self

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

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

impl Display for VfError

Source§

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

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 From<VfError> for Error

Source§

fn from(error: VfError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for VfError

Source§

fn eq(&self, other: &Self) -> 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.