pub struct HashCodeMap { /* private fields */ }Expand description
A container for associating hashes with their original label and vice versa.
Implementations§
Source§impl HashCodeMap
impl HashCodeMap
Sourcepub fn get() -> Arc<Mutex<Self>>
pub fn get() -> Arc<Mutex<Self>>
Returns a thread-safe reference-counting pointer to the mutually exclusive HashCodeMap.
Sourcepub fn label_of(&self, hash: HashCode, width: Option<u32>) -> Option<&String>
pub fn label_of(&self, hash: HashCode, width: Option<u32>) -> Option<&String>
Returns a reference to the label corresponding to the hash.
Sourcepub fn hash_of(&self, label: &str) -> Option<HashCode>
pub fn hash_of(&self, label: &str) -> Option<HashCode>
Returns the hash corresponding to the label.
Sourcepub fn extend_shift_jis<I: IntoIterator<Item = String>>(
&mut self,
iter: I,
) -> Result<(), ParseLabelError>
pub fn extend_shift_jis<I: IntoIterator<Item = String>>( &mut self, iter: I, ) -> Result<(), ParseLabelError>
Hashes and inserts a collection of labels from an iterator, converting to Shift JIS.
Sourcepub fn extend_utf8<I: IntoIterator<Item = String>>(
&mut self,
iter: I,
) -> Result<(), ParseLabelError>
pub fn extend_utf8<I: IntoIterator<Item = String>>( &mut self, iter: I, ) -> Result<(), ParseLabelError>
Hashes and inserts a collection of labels from an iterator, interpreting as UTF-8.
Sourcepub fn read_shift_jis<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<(), ParseLabelError>
pub fn read_shift_jis<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), ParseLabelError>
Reads and hashes a newline-separated list of labels from a file, converting to Shift JIS.
Sourcepub fn read_utf8<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<(), ParseLabelError>
pub fn read_utf8<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), ParseLabelError>
Reads and hashes a newline-separated list of labels from a file, interpreting as UTF-8.
Sourcepub fn set_strict(&mut self, strict: bool)
pub fn set_strict(&mut self, strict: bool)
Updates whether foreign labels should be rejected when looking up the hash of a label.
Trait Implementations§
Source§impl Debug for HashCodeMap
impl Debug for HashCodeMap
Source§impl Default for HashCodeMap
impl Default for HashCodeMap
Source§fn default() -> HashCodeMap
fn default() -> HashCodeMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HashCodeMap
impl RefUnwindSafe for HashCodeMap
impl Send for HashCodeMap
impl Sync for HashCodeMap
impl Unpin for HashCodeMap
impl UnsafeUnpin for HashCodeMap
impl UnwindSafe for HashCodeMap
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