Struct icu_provider_adapters::empty::EmptyDataProvider
source · 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::HelloWorldV1Marker;
use icu_provider::prelude::*;
use icu_provider_adapters::empty::EmptyDataProvider;
let provider = EmptyDataProvider::new();
assert!(matches!(
provider.load_any(HelloWorldV1Marker::INFO, 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 AnyProvider for EmptyDataProvider
impl AnyProvider for EmptyDataProvider
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) -> HashSet<DataMarkerInfo>
fn supported_markers(&self) -> HashSet<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
§impl<P> AsDowncastingAnyProvider for Pwhere
P: AnyProvider + ?Sized,
impl<P> AsDowncastingAnyProvider for Pwhere
P: AnyProvider + ?Sized,
§fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
Returns an object implementing
DynamicDataProvider<M>
when called on AnyProvider
§impl<P> AsDynamicDataProviderAnyMarkerWrap for Pwhere
P: DynamicDataProvider<AnyMarker> + ?Sized,
impl<P> AsDynamicDataProviderAnyMarkerWrap for Pwhere
P: DynamicDataProvider<AnyMarker> + ?Sized,
§fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>
fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>
Returns an object implementing
AnyProvider
when called on DynamicDataProvider<AnyMarker>
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