#[non_exhaustive]pub enum LiteralValue {
Bytes(Arc<Vec<u8>>),
Int(i64),
Bool(bool),
Ip(IpAddr),
Array(Arc<Vec<LiteralValue>>),
Map(Arc<HashMap<String, LiteralValue>>),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bytes(Arc<Vec<u8>>)
Int(i64)
Bool(bool)
Ip(IpAddr)
Array(Arc<Vec<LiteralValue>>)
Map(Arc<HashMap<String, LiteralValue>>)
Implementations§
Source§impl LiteralValue
impl LiteralValue
Sourcepub fn get_type(&self) -> FieldType
pub fn get_type(&self) -> FieldType
Infers the type of this literal value. For arrays/maps, if empty, returns Array(Unknown)/Map(Unknown) unless a hint is provided.
Sourcepub fn get_type_with_hint(&self, hint: Option<&FieldType>) -> FieldType
pub fn get_type_with_hint(&self, hint: Option<&FieldType>) -> FieldType
Infers the type of this literal value, using a type hint for empty arrays/maps. If hint is Some(Array(T)), then empty arrays will be typed as Array(T) instead of Array(Unknown).
Trait Implementations§
Source§impl Clone for LiteralValue
impl Clone for LiteralValue
Source§fn clone(&self) -> LiteralValue
fn clone(&self) -> LiteralValue
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 LiteralValue
impl Debug for LiteralValue
Source§impl<'de> Deserialize<'de> for LiteralValue
impl<'de> Deserialize<'de> for LiteralValue
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 PartialEq for LiteralValue
impl PartialEq for LiteralValue
Source§impl Serialize for LiteralValue
impl Serialize for LiteralValue
impl Eq for LiteralValue
Auto Trait Implementations§
impl Freeze for LiteralValue
impl RefUnwindSafe for LiteralValue
impl Send for LiteralValue
impl Sync for LiteralValue
impl Unpin for LiteralValue
impl UnwindSafe for LiteralValue
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