pub struct HectareData { /* private fields */ }Implementations§
Source§impl HectareData
impl HectareData
Sourcepub async fn new(
url_or_path: &str,
force_rebuild_cache: bool,
cache_prefix: Option<String>,
) -> Result<Self, Box<dyn Error>>
pub async fn new( url_or_path: &str, force_rebuild_cache: bool, cache_prefix: Option<String>, ) -> Result<Self, Box<dyn Error>>
Loads and parses the data. If an URL is provided, the data containing the population per hectare is loaded from the specified URL which is downloaded automatically. If a path is provided, it must absolutely point to an valid archive (ZIP file). The ZIP archive is automatically decompressed into the temp_dir of the OS folder.
pub fn data(self) -> Vec<HectareRecord>
Trait Implementations§
Source§impl Debug for HectareData
impl Debug for HectareData
Source§impl<'de> Deserialize<'de> for HectareData
impl<'de> Deserialize<'de> for HectareData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HectareData
impl RefUnwindSafe for HectareData
impl Send for HectareData
impl Sync for HectareData
impl Unpin for HectareData
impl UnwindSafe for HectareData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more