pub struct FfiCoreError {
pub kind: String,
pub message: String,
}Expand description
Summary of a core error, carried across the FFI boundary.
The core’s Error is a #[non_exhaustive] rich error enum (carrying
String, usize and other payloads) and is not a UniFFI type: UniFFI requires
every field of an error enum to implement Lift/Lower/TypeId, and with
#[uniffi(flat_error)] the variants would cross the boundary as Display text
only, leaving the client one opaque string and no way to dispatch the UI by
failure reason. This type carries two fields:
kind: a stable machine-readable identifier the client branches onmessage: user-facing text, for display and logs only
Fields§
§kind: StringStable error identifier; see the contract in core_error_kind.
message: StringHuman-readable error text (identical to the core’s Display).
Trait Implementations§
Source§impl Clone for FfiCoreError
impl Clone for FfiCoreError
Source§impl<UT> ConvertError<UT> for FfiCoreError
impl<UT> ConvertError<UT> for FfiCoreError
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl Debug for FfiCoreError
impl Debug for FfiCoreError
Source§impl Display for FfiCoreError
Lets FfiCoreError take part in an outer error’s text through Display.
impl Display for FfiCoreError
Lets FfiCoreError take part in an outer error’s text through Display.
Written by hand rather than derived: Display outputs message and does not
repeat kind — kind is meant for programs, and putting it into user-facing
text only adds noise.
It is needed because #[error("{source}")] requires source to implement
Display; otherwise thiserror treats it as Error::source() instead and
reports an unsatisfied as_dyn_error trait bound.
impl Eq for FfiCoreError
Source§impl<UT> FfiConverter<UT> for FfiCoreError
impl<UT> FfiConverter<UT> for FfiCoreError
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl From<Error> for FfiCoreError
impl From<Error> for FfiCoreError
Source§impl<UT> Lift<UT> for FfiCoreError
impl<UT> Lift<UT> for FfiCoreError
Source§impl<UT> LiftRef<UT> for FfiCoreError
impl<UT> LiftRef<UT> for FfiCoreError
type LiftType = FfiCoreError
Source§impl<UT> LiftReturn<UT> for FfiCoreError
impl<UT> LiftReturn<UT> for FfiCoreError
Source§type ReturnType = <FfiCoreError as Lift<UT>>::FfiType
type ReturnType = <FfiCoreError as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for FfiCoreError
impl<UT> Lower<UT> for FfiCoreError
type FfiType = <FfiCoreError as FfiConverter<UT>>::FfiType
fn lower(obj: Self) -> Self::FfiType
fn write(obj: Self, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for FfiCoreError
impl<UT> LowerError<UT> for FfiCoreError
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for FfiCoreError
impl<UT> LowerReturn<UT> for FfiCoreError
Source§type ReturnType = <FfiCoreError as Lower<UT>>::FfiType
type ReturnType = <FfiCoreError as Lower<UT>>::FfiType
Source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl PartialEq for FfiCoreError
impl PartialEq for FfiCoreError
impl StructuralPartialEq for FfiCoreError
Source§impl<UT> TypeId<UT> for FfiCoreError
impl<UT> TypeId<UT> for FfiCoreError
Auto Trait Implementations§
impl Freeze for FfiCoreError
impl RefUnwindSafe for FfiCoreError
impl Send for FfiCoreError
impl Sync for FfiCoreError
impl Unpin for FfiCoreError
impl UnsafeUnpin for FfiCoreError
impl UnwindSafe for FfiCoreError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.