pub struct EmptyDataProvider { /* private fields */ }
Expand description
A data provider that always returns an error.
The returned error kind is configurable.
§Examples
use icu_provider::hello_world::HelloWorldV1;
use icu_provider::prelude::*;
use icu_provider_adapters::empty::EmptyDataProvider;
let provider = EmptyDataProvider::new();
assert!(matches!(
DataProvider::<HelloWorldV1>::load(&provider, Default::default()),
Err(DataError {
kind: DataErrorKind::MarkerNotFound,
..
})
));
Implementations§
Source§impl EmptyDataProvider
impl EmptyDataProvider
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a data provider that always returns [DataErrorKind::MarkerNotFound
].
Sourcepub fn new_with_error_kind(error_kind: DataErrorKind) -> Self
pub fn new_with_error_kind(error_kind: DataErrorKind) -> Self
Creates a data provider that always returns the specified error kind.
Trait Implementations§
Source§impl<M> DataProvider<M> for EmptyDataProviderwhere
M: DataMarker,
impl<M> DataProvider<M> for EmptyDataProviderwhere
M: DataMarker,
Source§impl Debug for EmptyDataProvider
impl Debug for EmptyDataProvider
Source§impl Default for EmptyDataProvider
impl Default for EmptyDataProvider
Source§impl<M> DynamicDataProvider<M> for EmptyDataProviderwhere
M: DynamicDataMarker,
impl<M> DynamicDataProvider<M> for EmptyDataProviderwhere
M: DynamicDataMarker,
Source§impl ExportableProvider for EmptyDataProvider
impl ExportableProvider for EmptyDataProvider
Source§fn supported_markers(&self) -> BTreeSet<DataMarkerInfo>
fn supported_markers(&self) -> BTreeSet<DataMarkerInfo>
Returns the set of supported markers
Source§impl<M> IterableDataProvider<M> for EmptyDataProviderwhere
M: DataMarker,
impl<M> IterableDataProvider<M> for EmptyDataProviderwhere
M: DataMarker,
Source§impl<M> IterableDynamicDataProvider<M> for EmptyDataProviderwhere
M: DynamicDataMarker,
impl<M> IterableDynamicDataProvider<M> for EmptyDataProviderwhere
M: DynamicDataMarker,
Source§fn iter_ids_for_marker(
&self,
_: DataMarkerInfo,
) -> Result<BTreeSet<DataIdentifierCow<'_>>, DataError>
fn iter_ids_for_marker( &self, _: DataMarkerInfo, ) -> Result<BTreeSet<DataIdentifierCow<'_>>, DataError>
Given a [
DataMarkerInfo
], returns a set of [DataIdentifierCow
].Auto Trait Implementations§
impl Freeze for EmptyDataProvider
impl RefUnwindSafe for EmptyDataProvider
impl Send for EmptyDataProvider
impl Sync for EmptyDataProvider
impl Unpin for EmptyDataProvider
impl UnwindSafe for EmptyDataProvider
Blanket Implementations§
§impl<P> AsDeserializingBufferProvider for Pwhere
P: BufferProvider + ?Sized,
impl<P> AsDeserializingBufferProvider for Pwhere
P: BufferProvider + ?Sized,
§fn as_deserializing(&self) -> DeserializingBufferProvider<'_, P>
fn as_deserializing(&self) -> DeserializingBufferProvider<'_, P>
Wrap this [BufferProvider
] in a [DeserializingBufferProvider
].
This requires enabling the deserialization Cargo feature for the expected format(s):
deserialize_json
deserialize_postcard_1
deserialize_bincode_1
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
Mutably borrows from an owned value. Read more
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>
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 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>
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