pub struct Loader { /* private fields */ }
Expand description
Manages the lifecycle of the loaded ICU data.
Loader
can be created using Loader::new
and can be cloned. For as long as any Loader
remains in scope, the ICU data will not be unloaded.
Implementations§
Source§impl Loader
impl Loader
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Initializes the ICU dynamic timezone data, based on the default resource directory.
The caller should create a Loader
very early on in the lifetime of the program, and keep
instances of Loader
alive until the ICU data is needed. You can make as many Loader
objects as you need. The data will be unloaded only after the last of them leaves scope.
Sourcepub fn new_with_tz_resource_path(tzdata_dir_path: &str) -> Result<Self, Error>
pub fn new_with_tz_resource_path(tzdata_dir_path: &str) -> Result<Self, Error>
Initializes ICU data, loading time zone resources from the supplied path
.
See documentation for new
for calling constraints.
Sourcepub fn new_with_tz_resources_and_validation(
tzdata_dir_path: &str,
tz_revision_file_path: &str,
) -> Result<Self, Error>
pub fn new_with_tz_resources_and_validation( tzdata_dir_path: &str, tz_revision_file_path: &str, ) -> Result<Self, Error>
Initializes ICU data, loading time zone resources from the supplied path
and validating
the time zone revision ID against the ID contained in the file at revision_file_path
.
See documentation for new
for calling constraints.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Loader
impl RefUnwindSafe for Loader
impl Send for Loader
impl Unpin for Loader
impl UnwindSafe for Loader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)