pub enum DictionaryEntryId {
U1(u8),
U2(u16),
U4(u32),
U8(u64),
U16(u128),
}Expand description
A dictionary entry ID that can be one of several unsigned integer sizes.
The variant used depends on the dictionary’s id_type configuration.
Variants§
Implementations§
Source§impl DictionaryEntryId
impl DictionaryEntryId
Sourcepub fn from_u128(value: u128, id_type: Type) -> Result<Self>
pub fn from_u128(value: u128, id_type: Type) -> Result<Self>
Create a DictionaryEntryId from a u128 value and the target Type. Returns an error if the value doesn’t fit in the specified type.
Sourcepub fn to_u128(&self) -> u128
pub fn to_u128(&self) -> u128
Convert this ID to a u128 value for internal storage/computation.
Sourcepub fn from_value(value: &Value) -> Option<Self>
pub fn from_value(value: &Value) -> Option<Self>
Create a DictionaryEntryId from a Value. Returns None if the Value is not an unsigned integer type.
Trait Implementations§
Source§impl Clone for DictionaryEntryId
impl Clone for DictionaryEntryId
Source§fn clone(&self) -> DictionaryEntryId
fn clone(&self) -> DictionaryEntryId
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DictionaryEntryId
impl Debug for DictionaryEntryId
Source§impl<'de> Deserialize<'de> for DictionaryEntryId
impl<'de> Deserialize<'de> for DictionaryEntryId
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 Display for DictionaryEntryId
impl Display for DictionaryEntryId
Source§impl Hash for DictionaryEntryId
impl Hash for DictionaryEntryId
Source§impl PartialEq for DictionaryEntryId
impl PartialEq for DictionaryEntryId
Source§impl Serialize for DictionaryEntryId
impl Serialize for DictionaryEntryId
impl Copy for DictionaryEntryId
impl Eq for DictionaryEntryId
impl StructuralPartialEq for DictionaryEntryId
Auto Trait Implementations§
impl Freeze for DictionaryEntryId
impl RefUnwindSafe for DictionaryEntryId
impl Send for DictionaryEntryId
impl Sync for DictionaryEntryId
impl Unpin for DictionaryEntryId
impl UnwindSafe for DictionaryEntryId
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)