#[non_exhaustive]pub enum BackendError {
Valkey {
kind: BackendErrorKind,
message: String,
},
RequiresDevMode,
}Expand description
Backend-agnostic transport error carried across public ff-sdk / ff-server error surfaces (#88).
The Valkey variant is the only one populated today; additional
variants (e.g. Postgres) will be added additively as other
backends land. The enum is #[non_exhaustive] so consumers must
include a wildcard arm.
Construction from the Valkey-native ferriskey::Error lives in
ff_backend_valkey::backend_error_from_ferriskey — keeping that
conversion outside ff-core preserves ff-core’s ferriskey-free
public surface.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Valkey
Valkey-backend transport failure. Carries a backend-agnostic classification plus the backend-rendered message so downstream consumers can inspect without depending on ferriskey.
RequiresDevMode
RFC-023 §4.5: the SQLite dev-only backend refused to construct
because FF_DEV_MODE=1 was not set. Exact message text mirrors
§3.3 HTTP-path text so embedded and server paths give the same
actionable signal.
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub fn kind(&self) -> BackendErrorKind
pub fn kind(&self) -> BackendErrorKind
Returns the classified backend kind.
Every variant maps to a BackendErrorKind — transport
variants return their carried kind, configuration/guard
variants return the closest-fitting classification (e.g.
BackendError::RequiresDevMode → BackendErrorKind::Protocol
because it is a configuration refusal, not a retryable
transport fault). Consumers needing to distinguish the
underlying variant should match directly on BackendError;
kind() is the stable, classifier-only view.
Trait Implementations§
Source§impl Clone for BackendError
impl Clone for BackendError
Source§fn clone(&self) -> BackendError
fn clone(&self) -> BackendError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
Source§impl Error for BackendError
impl Error for BackendError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BackendError> for SdkError
impl From<BackendError> for SdkError
Source§fn from(source: BackendError) -> Self
fn from(source: BackendError) -> Self
Auto Trait Implementations§
impl Freeze for BackendError
impl RefUnwindSafe for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
impl UnwindSafe for BackendError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.