pub struct WordListMetadata {
pub name: Cow<'static, str>,
pub script: Option<Cow<'static, str>>,
pub language: Option<Cow<'static, str>>,
}Expand description
Metadata about a WordList.
If you don’t want to mess around with the 🐄s, convenience methods are provided for reading fields:
Fields§
§name: Cow<'static, str>The cosmetic name for the word list
script: Option<Cow<'static, str>>The script of the word list, if known.
The script is expected to be an ISO 15924 four-letter capitalised code.
language: Option<Cow<'static, str>>The language of the word list, if known.
The language is expected to be an ISO 639-1 two-letter code.
Implementations§
Source§impl WordListMetadata
impl WordListMetadata
Sourcepub fn load(metadata_path: impl AsRef<Path>) -> Result<Self, WordListError>
pub fn load(metadata_path: impl AsRef<Path>) -> Result<Self, WordListError>
Load metadata from an on-disk TOML file
Trait Implementations§
Source§impl Clone for WordListMetadata
impl Clone for WordListMetadata
Source§fn clone(&self) -> WordListMetadata
fn clone(&self) -> WordListMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WordListMetadata
impl Debug for WordListMetadata
Source§impl<'de> Deserialize<'de> for WordListMetadata
impl<'de> Deserialize<'de> for WordListMetadata
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
Source§impl<S> From<S> for WordListMetadata
impl<S> From<S> for WordListMetadata
Source§impl Hash for WordListMetadata
impl Hash for WordListMetadata
Source§impl PartialEq for WordListMetadata
impl PartialEq for WordListMetadata
impl Eq for WordListMetadata
impl StructuralPartialEq for WordListMetadata
Auto Trait Implementations§
impl Freeze for WordListMetadata
impl RefUnwindSafe for WordListMetadata
impl Send for WordListMetadata
impl Sync for WordListMetadata
impl Unpin for WordListMetadata
impl UnwindSafe for WordListMetadata
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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