Trait icu_provider::BoundDataProvider

source ·
pub trait BoundDataProvider<M>{
    // Required methods
    fn load_bound(
        &self,
        req: DataRequest<'_>,
    ) -> Result<DataResponse<M>, DataError>;
    fn bound_marker(&self) -> DataMarkerInfo;
}
Expand description

A data provider that loads data for a specific data type.

Unlike DataProvider, the provider is bound to a specific marker ahead of time.

This crate provides DataProviderWithMarker which implements this trait on a single provider with a single marker. However, this trait can also be implemented on providers that fork between multiple markers that all return the same data type. For example, it can abstract over many calendar systems in the datetime formatter.

Required Methods§

source

fn load_bound(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result.

Returns Ok if the request successfully loaded data. If data failed to load, returns an Error with more information.

source

fn bound_marker(&self) -> DataMarkerInfo

Returns the DataMarkerInfo that this provider uses for loading data.

Implementations on Foreign Types§

source§

impl<M, P> BoundDataProvider<M> for &P

source§

impl<M, P> BoundDataProvider<M> for Box<P>

source§

impl<M, P> BoundDataProvider<M> for Rc<P>

source§

impl<M, P> BoundDataProvider<M> for Arc<P>

Implementors§

source§

impl<M, M0, Y, P> BoundDataProvider<M0> for DataProviderWithMarker<M, P>
where M: DataMarker<DataStruct = Y>, M0: DynamicDataMarker<DataStruct = Y>, Y: for<'a> Yokeable<'a>, P: DataProvider<M>,