[−][src]Trait icu_provider::prelude::DataProvider
An abstract data provider that takes a request object and returns a response with a payload. Lifetimes:
- 'a = lifetime of the
DataProvider
object - 'd = lifetime of the borrowed payload Note: 'd and 'a can be the same, but they do not need to be. For example, 'd = 'static if:
- The provider always returns data that lives in static memory
- The provider always returns owned data, not borrowed data
Required methods
fn load<'a>(&'a self, req: &DataRequest) -> Result<DataResponse<'d>, Error>
Query the provider for data. Returns Ok if the request successfully loaded data. If data failed to load, returns an Error with more information.
Implementations
impl<'d> dyn DataProvider<'d> + 'd
[src]
pub fn load_graceful(
&self,
req: &DataRequest
) -> Result<Option<DataResponse<'d>>, Error>
[src]
&self,
req: &DataRequest
) -> Result<Option<DataResponse<'d>>, Error>
Query the provider for data. Returns Ok(Some) if the request successfully loaded data. If data failed to load due to the provider not supporting the requested category or data key, returns Ok(None). Otherwise, returns an Error.