pub trait DataProvider<M>where
M: KeyedDataMarker,{
// Required method
fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>;
}Expand description
A data provider that loads data for a specific DataKey.
Required Methods§
Sourcefn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>
fn load(&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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, M, P> DataProvider<M> for &'a P
impl<'a, M, P> DataProvider<M> for &'a P
fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>
Source§impl<M, P> DataProvider<M> for Arc<P>
Available on target_has_atomic=ptr only.
impl<M, P> DataProvider<M> for Arc<P>
Available on
target_has_atomic=ptr only.