Skip to main content

FfiError

Enum FfiError 

Source
pub enum FfiError {
    Auth {
        code: Option<String>,
        detail: String,
    },
    Upload {
        code: Option<String>,
        detail: String,
    },
    Sync {
        code: Option<String>,
        detail: String,
    },
    Workspace {
        detail: String,
    },
    Label {
        refusal: FfiLabelRefusal,
        detail: String,
    },
    Trash {
        refusal: FfiTrashRefusal,
        code: Option<String>,
        retention_until: Option<String>,
        detail: String,
    },
    Escrow {
        code: Option<String>,
        detail: String,
    },
    Directory {
        code: Option<String>,
        detail: String,
    },
    Fetch {
        code: Option<String>,
        detail: String,
    },
    InvalidArgument {
        detail: String,
    },
}
Expand description

Every failure the FFI flows can surface, flattened by originating layer. Each variant carries the stable error.* catalog code (when one applies — clients localize it) and the English detail (stays English), mirroring the SDK’s { error, code } contract so foreign apps switch on the code, never a bare HTTP status.

Variants§

§

Auth

An authentication flow (login/register/refresh/logout) failed.

Fields

§code: Option<String>

Stable error.* catalog code, when the SDK mapped one.

§detail: String

English detail (developer/log message).

§

Upload

An upload flow (create/transfer/status) failed.

Fields

§code: Option<String>

Stable error.* catalog code, when the server supplied one.

§detail: String

English detail (developer/log message).

§

Sync

A sync flow (pull/reconcile) failed.

Fields

§code: Option<String>

Stable error.* catalog code, when one applies.

§detail: String

English detail (developer/log message).

§

Workspace

A local workspace operation failed — opening the library, sealing an asset, reading a managed asset. This is the workspace failing, never an entry being refused: a refused sync entry is a FfiSyncApplyOutcome::Quarantined verdict, not an error.

Fields

§detail: String

English detail (developer/log message).

§

Label

A label or region edit was refused before anything was written: its target does not exist, the label rule refused the label, or the shape broke the normalized-coordinate contract. refusal says which, so an editor shows the reason rather than parsing detail.

Fields

§refusal: FfiLabelRefusal

Why the edit was refused.

§detail: String

English detail (developer/log message).

§

Trash

A trash verb (delete, restore, purge) was refused before anything was written: the asset is unknown, not in the trash, or past its signed retention window. refusal says which.

Fields

§refusal: FfiTrashRefusal

Why the verb was refused.

§code: Option<String>

Stable error.* catalog code, when one applies: error.upload.retention_elapsed for FfiTrashRefusal::RetentionElapsed, the code the server answers the same refusal with.

§retention_until: Option<String>

The signed retention floor (RFC 3339) a refused restore came too late for.

§detail: String

English detail (developer/log message).

§

Escrow

A master-key escrow flow (store/fetch) failed.

Fields

§code: Option<String>

Stable error.* catalog code, when the server supplied one — error.escrow.* separates “you have no recovery backup” (a setup prompt) from “we could not read it” (a retry), which is the whole reason the catalog distinguishes them.

§detail: String

English detail (developer/log message).

§

Directory

A device-directory flow (publish/fetch) failed.

Fields

§code: Option<String>

Stable error.* catalog code, when one applies.

§detail: String

English detail (developer/log message).

§

Fetch

A blob fetch (FfiSession::fetch_blob_to_path) failed: the blob is gone, still awaiting its original, refused, did not hash to its content address, or could not be written locally. Nothing is left at the destination path.

Fields

§code: Option<String>

Stable error.* catalog code, when one applies (e.g. error.blob.pending_upload; error.blob.gone for a blob or record the server will never serve again: a 410 past a retention window or under a takedown, or a 404).

§detail: String

English detail (developer/log message).

§

InvalidArgument

A foreign argument was structurally invalid (e.g. an un-parseable URL) before any network call.

Fields

§detail: String

What was wrong with the argument.

Trait Implementations§

Source§

impl<UT> ConvertError<UT> for FfiError

Source§

fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>

Source§

impl Debug for FfiError

Source§

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

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

impl Display for FfiError

Source§

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

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

impl Error for FfiError

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<UT> FfiConverter<UT> for FfiError

Source§

const TYPE_ID_META: MetadataBuffer

Type ID metadata, serialized into a [MetadataBuffer].
Source§

type FfiType = RustBuffer

The low-level type used for passing values of this type over the FFI. Read more
Source§

fn lower(v: Self) -> RustBuffer

Lower a rust value of the target type, into an FFI value of type Self::FfiType. Read more
Source§

fn try_lift(buf: RustBuffer) -> Result<Self>

Lift a rust value of the target type, from an FFI value of type Self::FfiType. Read more
Source§

fn write(obj: Self, buf: &mut Vec<u8>)

Write a rust value into a buffer, to send over the FFI in serialized form. Read more
Source§

fn try_read(buf: &mut &[u8]) -> Result<Self>

Read a rust value from a buffer, received over the FFI in serialized form. Read more
Source§

impl From<AuthError> for FfiError

Source§

fn from(err: AuthError) -> Self

Converts to this type from the input type.
Source§

impl From<DirectoryError> for FfiError

Source§

fn from(err: DirectoryError) -> Self

Converts to this type from the input type.
Source§

impl From<FetchError> for FfiError

Source§

fn from(err: FetchError) -> Self

Converts to this type from the input type.
Source§

impl From<HistoryError> for FfiError

Source§

fn from(err: HistoryError) -> Self

Converts to this type from the input type.
Source§

impl From<LifecycleError> for FfiError

Source§

fn from(err: LifecycleError) -> Self

Converts to this type from the input type.
Source§

impl From<PushError> for FfiError

Source§

fn from(err: PushError) -> Self

Converts to this type from the input type.
Source§

impl From<RecoveryError> for FfiError

Source§

fn from(err: RecoveryError) -> Self

Converts to this type from the input type.
Source§

impl From<SyncError> for FfiError

Source§

fn from(err: SyncError) -> Self

Converts to this type from the input type.
Source§

impl From<UploadError> for FfiError

Source§

fn from(err: UploadError) -> Self

Converts to this type from the input type.
Source§

impl<UT> Lift<UT> for FfiError

Source§

type FfiType = <FfiError as FfiConverter<UT>>::FfiType

Source§

fn try_lift(v: Self::FfiType) -> Result<Self>

Source§

fn try_read(buf: &mut &[u8]) -> Result<Self>

§

fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>

Convenience method
Source§

impl<UT> LiftRef<UT> for FfiError

Source§

impl<UT> LiftReturn<UT> for FfiError

Source§

type ReturnType = <FfiError as Lift<UT>>::FfiType

FFI return type for trait interfaces
Source§

fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>

Lift a successfully returned value from a trait interface
§

fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self

Lift a foreign returned value from a trait interface Read more
§

fn lift_error(_buf: RustBuffer) -> Self

Lift a Rust value for a callback interface method error result Read more
§

fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self

Lift a Rust value for an unexpected callback interface error Read more
Source§

impl<UT> Lower<UT> for FfiError

Source§

type FfiType = <FfiError as FfiConverter<UT>>::FfiType

Source§

fn lower(obj: Self) -> Self::FfiType

Source§

fn write(obj: Self, buf: &mut Vec<u8>)

§

fn lower_into_rust_buffer(obj: Self) -> RustBuffer

Convenience method
Source§

impl<UT> LowerError<UT> for FfiError

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for FfiError

Source§

type ReturnType = <FfiError as Lower<UT>>::FfiType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for FfiError

Source§

const TYPE_ID_META: MetadataBuffer

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>
where T: Sized,

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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