pub enum Value<VS = ScopeValue> {
Null,
Basic(BasicValue),
Struct(FieldValues<VS>),
UTable(Vec<VS>),
KTable(BTreeMap<KeyValue, VS>),
LTable(Vec<VS>),
}Variants§
Null
Basic(BasicValue)
Struct(FieldValues<VS>)
UTable(Vec<VS>)
KTable(BTreeMap<KeyValue, VS>)
LTable(Vec<VS>)
Implementations§
Source§impl<VS> Value<VS>
impl<VS> Value<VS>
pub fn from_alternative<AltVS>(value: Value<AltVS>) -> Selfwhere
AltVS: Into<VS>,
pub fn from_alternative_ref<AltVS>(value: &Value<AltVS>) -> Self
pub fn is_null(&self) -> bool
pub fn into_key(self) -> Result<KeyPart>
pub fn as_key(&self) -> Result<KeyPart>
pub fn kind(&self) -> &'static str
pub fn optional(&self) -> Option<&Self>
pub fn as_bytes(&self) -> Result<&Bytes>
pub fn as_str(&self) -> Result<&Arc<str>>
pub fn as_bool(&self) -> Result<bool>
pub fn as_int64(&self) -> Result<i64>
pub fn as_float32(&self) -> Result<f32>
pub fn as_float64(&self) -> Result<f64>
pub fn as_range(&self) -> Result<RangeValue>
pub fn as_json(&self) -> Result<&Arc<Value>>
pub fn as_vector(&self) -> Result<&Arc<[BasicValue]>>
pub fn as_struct(&self) -> Result<&FieldValues<VS>>
Source§impl<VS: EstimatedByteSize> Value<VS>
impl<VS: EstimatedByteSize> Value<VS>
pub fn estimated_byte_size(&self) -> usize
Trait Implementations§
Source§impl From<FieldValues> for Value
impl From<FieldValues> for Value
Source§fn from(value: FieldValues) -> Self
fn from(value: FieldValues) -> Self
Converts to this type from the input type.
Source§impl Serialize for Value<ScopeValue>
impl Serialize for Value<ScopeValue>
impl<VS> StructuralPartialEq for Value<VS>
Auto Trait Implementations§
impl<VS = ScopeValue> !Freeze for Value<VS>
impl<VS> RefUnwindSafe for Value<VS>where
VS: RefUnwindSafe,
impl<VS> Send for Value<VS>where
VS: Send,
impl<VS> Sync for Value<VS>where
VS: Sync,
impl<VS> Unpin for Value<VS>where
VS: Unpin,
impl<VS> UnwindSafe for Value<VS>where
VS: RefUnwindSafe + UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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