Trait icu_provider::BoundDataProvider
source · pub trait BoundDataProvider<M>where
M: DynamicDataMarker,{
// 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§
sourcefn load_bound(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>
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.
sourcefn bound_marker(&self) -> DataMarkerInfo
fn bound_marker(&self) -> DataMarkerInfo
Returns the DataMarkerInfo
that this provider uses for loading data.