pub struct DictionaryHandle { /* private fields */ }Expand description
Shared pre-parsed dictionary handle for repeated decoding.
Uses Arc on targets with atomics and falls back to Rc otherwise.
Implementations§
Source§impl DictionaryHandle
impl DictionaryHandle
Sourcepub fn from_dictionary(dict: Dictionary) -> Self
pub fn from_dictionary(dict: Dictionary) -> Self
Wrap an already-parsed dictionary in a shared handle.
Sourcepub fn decode_dict(raw: &[u8]) -> Result<Self, DictionaryDecodeError>
pub fn decode_dict(raw: &[u8]) -> Result<Self, DictionaryDecodeError>
Parse a serialized dictionary and return a reusable shared handle.
pub fn id(&self) -> u32
pub fn as_dict(&self) -> &Dictionary
Trait Implementations§
Source§impl AsRef<Dictionary> for DictionaryHandle
impl AsRef<Dictionary> for DictionaryHandle
Source§fn as_ref(&self) -> &Dictionary
fn as_ref(&self) -> &Dictionary
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for DictionaryHandle
impl Clone for DictionaryHandle
Source§fn clone(&self) -> DictionaryHandle
fn clone(&self) -> DictionaryHandle
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 From<Dictionary> for DictionaryHandle
impl From<Dictionary> for DictionaryHandle
Source§fn from(dict: Dictionary) -> Self
fn from(dict: Dictionary) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DictionaryHandle
impl RefUnwindSafe for DictionaryHandle
impl Send for DictionaryHandle
impl Sync for DictionaryHandle
impl Unpin for DictionaryHandle
impl UnsafeUnpin for DictionaryHandle
impl UnwindSafe for DictionaryHandle
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