#[non_exhaustive]pub enum DataErrorKind {
MissingDataKey,
MissingLocale,
NeedsLocale,
ExtraneousLocale,
FilteredResource,
MismatchedType(&'static str),
MissingPayload,
InvalidState,
KeyLocaleSyntax,
Custom,
UnavailableBufferFormat(BufferFormat),
}
Expand description
A list specifying general categories of data provider error.
Errors may be caused either by a malformed request or by the data provider not being able to fulfill a well-formed request.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingDataKey
No data for the provided resource key.
MissingLocale
There is data for the key, but not for this particular locale.
NeedsLocale
The request should include a locale.
ExtraneousLocale
The request should not contain a locale.
FilteredResource
The resource was blocked by a filter. The resource may or may not be available.
MismatchedType(&'static str)
The generic type parameter does not match the TypeId. The expected type name is stored as context when this error is returned.
MissingPayload
The payload is missing. This is usually caused by a previous error.
InvalidState
A data provider object was given to an operation in an invalid state.
KeyLocaleSyntax
The syntax of the DataKey
or DataLocale
was invalid.
Custom
An unspecified error occurred, such as a Serde error.
Check debug logs for potentially more information.
An error indicating that the desired buffer format is not available. This usually means that a required Cargo feature was not enabled
Implementations§
Source§impl DataErrorKind
impl DataErrorKind
Sourcepub const fn into_error(self) -> DataError
pub const fn into_error(self) -> DataError
Converts this DataErrorKind into a DataError.
If possible, you should attach context using a with_
function.
Sourcepub const fn with_key(self, key: DataKey) -> DataError
pub const fn with_key(self, key: DataKey) -> DataError
Creates a DataError with a resource key context.
Sourcepub const fn with_str_context(self, context: &'static str) -> DataError
pub const fn with_str_context(self, context: &'static str) -> DataError
Creates a DataError with a string context.
Sourcepub fn with_type_context<T>(self) -> DataError
pub fn with_type_context<T>(self) -> DataError
Creates a DataError with a type name context.
Sourcepub fn with_req(self, key: DataKey, req: DataRequest<'_>) -> DataError
pub fn with_req(self, key: DataKey, req: DataRequest<'_>) -> DataError
Creates a DataError with a request context.
Trait Implementations§
Source§impl Clone for DataErrorKind
impl Clone for DataErrorKind
Source§fn clone(&self) -> DataErrorKind
fn clone(&self) -> DataErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DataErrorKind
impl Debug for DataErrorKind
Source§impl Display for DataErrorKind
impl Display for DataErrorKind
Source§impl PartialEq for DataErrorKind
impl PartialEq for DataErrorKind
impl Copy for DataErrorKind
impl Eq for DataErrorKind
impl StructuralPartialEq for DataErrorKind
Auto Trait Implementations§
impl Freeze for DataErrorKind
impl RefUnwindSafe for DataErrorKind
impl Send for DataErrorKind
impl Sync for DataErrorKind
impl Unpin for DataErrorKind
impl UnwindSafe for DataErrorKind
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)