pub enum Value {
String(String),
Double(OrderedFloat<f64>),
Bool(bool),
Long(i64),
UnsignedLong(u64),
Duration(Duration),
Base64Binary(Vec<u8>),
TimeRFC(DateTime<FixedOffset>),
Null,
}Expand description
Represents a value in an InfluxDB Flux query result.
This enum covers all data types that can appear in InfluxDB annotated CSV responses.
Variants§
String(String)
String value.
Double(OrderedFloat<f64>)
64-bit floating point value.
Bool(bool)
Boolean value.
Long(i64)
Signed 64-bit integer.
UnsignedLong(u64)
Unsigned 64-bit integer.
Duration(Duration)
Duration value (in nanoseconds, stored as chrono::Duration).
Base64Binary(Vec<u8>)
Base64-encoded binary data.
TimeRFC(DateTime<FixedOffset>)
RFC3339 timestamp with timezone.
Null
Null value.
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_string(&self) -> Option<&str>
pub fn as_string(&self) -> Option<&str>
Returns the value as a string reference if it is a String variant.
Sourcepub fn string(&self) -> Option<String>
pub fn string(&self) -> Option<String>
Returns the value as an owned string if it is a String variant.
Sourcepub fn as_unsigned_long(&self) -> Option<u64>
pub fn as_unsigned_long(&self) -> Option<u64>
Returns the value as a u64 if it is an UnsignedLong variant.
Sourcepub fn as_duration(&self) -> Option<&Duration>
pub fn as_duration(&self) -> Option<&Duration>
Returns the value as a chrono::Duration if it is a Duration variant.
Sourcepub fn as_binary(&self) -> Option<&[u8]>
pub fn as_binary(&self) -> Option<&[u8]>
Returns the value as a byte slice if it is a Base64Binary variant.
Sourcepub fn as_time(&self) -> Option<&DateTime<FixedOffset>>
pub fn as_time(&self) -> Option<&DateTime<FixedOffset>>
Returns the value as a DateTime if it is a TimeRFC variant.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.