Trait BoundDataProvider
trait BoundDataProvider<M>
where
M: DynamicDataMarker
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
fn load_bound(self: &Self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>Query the provider for data, returning the result.
Returns
Okif the request successfully loaded data. If data failed to load, returns an Error with more information.fn bound_marker(self: &Self) -> DataMarkerInfoReturns the
DataMarkerInfothat this provider uses for loading data.
Implementors
impl<M, P> BoundDataProvider for &Pimpl<M, M0, Y, P> BoundDataProvider for DataProviderWithMarker<M, P>