Struct MetadataLoader Copy item path Source pub struct MetadataLoader {}Expand description MetadataLoader is a loader for reading persisted metadata files.
§ Examples
use lindera_dictionary::loader::metadata::MetadataLoader;
use std::path::Path;
let metadata = MetadataLoader::load(Path::new("/path/to/dictionary" ))? ;
#[cfg(feature = "mmap" )]
let metadata = MetadataLoader::load_mmap(Path::new("/path/to/dictionary" ))? ;Loads metadata file (metadata.json) from the specified directory.
§ Arguments
input_dir - Path to the directory containing the metadata file
§ Returns
The loaded Metadata object, or an error
§ Errors
Returns an error if file reading fails or deserialization fails.
Loads metadata file using memory mapping.
This method is only available when the “mmap” feature is enabled.
It’s useful for efficiently reading large files.
§ Arguments
input_dir - Path to the directory containing the metadata file
§ Returns
The loaded Metadata object, or an error
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.