Enum prometheus_http_query::response::Data
source · pub enum Data {
Vector(Vec<InstantVector>),
Matrix(Vec<RangeVector>),
Scalar(Sample),
}
Expand description
A wrapper for possible result types of expression queries (Client::query
and Client::query_range
).
Variants§
Implementations§
source§impl Data
impl Data
sourcepub fn as_vector_mut(&mut self) -> Option<&mut Vec<InstantVector>>
pub fn as_vector_mut(&mut self) -> Option<&mut Vec<InstantVector>>
Optionally returns mutable references to the inner fields if this is a Data::Vector
, otherwise None
sourcepub fn as_vector(&self) -> Option<&Vec<InstantVector>>
pub fn as_vector(&self) -> Option<&Vec<InstantVector>>
Optionally returns references to the inner fields if this is a Data::Vector
, otherwise None
sourcepub fn into_vector(self) -> Result<Vec<InstantVector>, Self>
pub fn into_vector(self) -> Result<Vec<InstantVector>, Self>
Returns the inner fields if this is a Data::Vector
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_matrix_mut(&mut self) -> Option<&mut Vec<RangeVector>>
pub fn as_matrix_mut(&mut self) -> Option<&mut Vec<RangeVector>>
Optionally returns mutable references to the inner fields if this is a Data::Matrix
, otherwise None
sourcepub fn as_matrix(&self) -> Option<&Vec<RangeVector>>
pub fn as_matrix(&self) -> Option<&Vec<RangeVector>>
Optionally returns references to the inner fields if this is a Data::Matrix
, otherwise None
sourcepub fn into_matrix(self) -> Result<Vec<RangeVector>, Self>
pub fn into_matrix(self) -> Result<Vec<RangeVector>, Self>
Returns the inner fields if this is a Data::Matrix
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_scalar_mut(&mut self) -> Option<&mut Sample>
pub fn as_scalar_mut(&mut self) -> Option<&mut Sample>
Optionally returns mutable references to the inner fields if this is a Data::Scalar
, otherwise None
sourcepub fn as_scalar(&self) -> Option<&Sample>
pub fn as_scalar(&self) -> Option<&Sample>
Optionally returns references to the inner fields if this is a Data::Scalar
, otherwise None
sourcepub fn into_scalar(self) -> Result<Sample, Self>
pub fn into_scalar(self) -> Result<Sample, Self>
Returns the inner fields if this is a Data::Scalar
, otherwise returns back the enum in the Err
case of the result