pub struct VariantVal {
data: Box<[u8]>,
}Expand description
Owned value of the variant type.
The inner bytes are the little-endian metadata length followed by the Apache Parquet / Iceberg
Variant metadata and value sections.
Fields§
§data: Box<[u8]>Implementations§
Source§impl VariantVal
impl VariantVal
pub fn null() -> Self
pub fn from_parts(metadata: &[u8], value: &[u8]) -> Result<Self>
fn from_canonical_parts(metadata: &[u8], value: &[u8]) -> Self
pub fn from_parquet_variant(variant: ParquetVariant<'_, '_>) -> Result<Self>
pub fn from_json_value(json: &Value) -> Result<Self>
pub fn try_from_scalar_ref( value: Option<ScalarRefImpl<'_>>, data_type: &DataType, ) -> Result<Self>
Sourcepub fn value_deserialize(buf: &[u8]) -> Option<Self>
pub fn value_deserialize(buf: &[u8]) -> Option<Self>
Decodes a value produced by VariantRef::value_serialize, checking structure only.
Use only on trusted bytes; external bytes must go through
Self::from_serialized_untrusted to re-establish the canonical invariants.
Sourcepub fn from_serialized_untrusted(buf: &[u8]) -> Result<Self>
pub fn from_serialized_untrusted(buf: &[u8]) -> Result<Self>
Decodes a buffer from an untrusted origin (e.g. pgwire binary parameters),
re-canonicalizing it so non-canonical inputs (unsorted dictionaries, non-canonical
float bit patterns) cannot break Eq/Hash/Ord.
pub fn memcmp_deserialize( deserializer: &mut Deserializer<impl Buf>, ) -> Result<Self>
pub fn from_jsonb(jsonb: JsonbRef<'_>) -> Result<Self>
pub fn metadata(&self) -> &[u8] ⓘ
pub fn value(&self) -> &[u8] ⓘ
pub fn parquet_variant(&self) -> ParquetVariant<'_, '_>
pub fn serialized_len(&self) -> usize
Trait Implementations§
Source§impl Clone for VariantVal
impl Clone for VariantVal
Source§fn clone(&self) -> VariantVal
fn clone(&self) -> VariantVal
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VariantVal
impl Debug for VariantVal
Source§impl Display for VariantVal
impl Display for VariantVal
impl Eq for VariantVal
Source§impl EstimateSize for VariantVal
impl EstimateSize for VariantVal
Source§fn estimated_heap_size(&self) -> usize
fn estimated_heap_size(&self) -> usize
The estimated heap size of the current struct in bytes.
Source§fn estimated_size(&self) -> usizewhere
Self: Sized,
fn estimated_size(&self) -> usizewhere
Self: Sized,
The estimated total size of the current struct in bytes, including the
estimated_heap_size
and the size of Self.Source§impl From<VariantRef<'_>> for VariantVal
impl From<VariantRef<'_>> for VariantVal
Source§fn from(value: VariantRef<'_>) -> Self
fn from(value: VariantRef<'_>) -> Self
Converts to this type from the input type.
Source§impl From<VariantVal> for ScalarImpl
impl From<VariantVal> for ScalarImpl
Source§fn from(val: VariantVal) -> Self
fn from(val: VariantVal) -> Self
Converts to this type from the input type.
Source§impl FromIterator<VariantVal> for VariantArray
impl FromIterator<VariantVal> for VariantArray
Source§fn from_iter<I: IntoIterator<Item = VariantVal>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = VariantVal>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a> FromSql<'a> for VariantVal
impl<'a> FromSql<'a> for VariantVal
Source§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres
Type.Source§fn from_sql(
ty: &Type,
raw: &'a [u8],
) -> Result<Self, Box<dyn Error + Sync + Send>>
fn from_sql( ty: &Type, raw: &'a [u8], ) -> Result<Self, Box<dyn Error + Sync + Send>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type in its binary format. Read moreSource§impl FromStr for VariantVal
impl FromStr for VariantVal
Source§impl Hash for VariantVal
impl Hash for VariantVal
Source§impl HashKeyDe for VariantVal
impl HashKeyDe for VariantVal
fn deserialize(data_type: &DataType, buf: impl Buf) -> Self
Source§impl Ord for VariantVal
impl Ord for VariantVal
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for VariantVal
impl PartialEq for VariantVal
Source§impl PartialOrd for VariantVal
impl PartialOrd for VariantVal
Source§impl RandValue for VariantVal
impl RandValue for VariantVal
fn rand_value<R: Rng>(_rand: &mut R) -> Self
Source§impl Scalar for VariantVal
impl Scalar for VariantVal
Source§type ScalarRefType<'a> = VariantRef<'a>
type ScalarRefType<'a> = VariantRef<'a>
Type for reference of
ScalarSource§fn as_scalar_ref(&self) -> Self::ScalarRefType<'_>
fn as_scalar_ref(&self) -> Self::ScalarRefType<'_>
Get a reference to current scalar.
fn to_scalar_value(self) -> ScalarImpl
Source§impl TryFrom<ScalarImpl> for VariantVal
impl TryFrom<ScalarImpl> for VariantVal
Source§type Error = ArrayError
type Error = ArrayError
The type returned in the event of a conversion error.
Source§fn try_from(val: ScalarImpl) -> ArrayResult<Self>
fn try_from(val: ScalarImpl) -> ArrayResult<Self>
Performs the conversion.
Source§impl WithDataType for VariantVal
impl WithDataType for VariantVal
Source§fn default_data_type() -> DataType
fn default_data_type() -> DataType
Returns the most obvious
DataType for the rust type.Source§impl<'a> WithDataType for &'a VariantVal
impl<'a> WithDataType for &'a VariantVal
Source§fn default_data_type() -> DataType
fn default_data_type() -> DataType
Returns the most obvious
DataType for the rust type.Source§impl<'a> WithDataType for &'a mut VariantVal
impl<'a> WithDataType for &'a mut VariantVal
Source§fn default_data_type() -> DataType
fn default_data_type() -> DataType
Returns the most obvious
DataType for the rust type.Source§impl WithDataType for Box<VariantVal>
impl WithDataType for Box<VariantVal>
Source§fn default_data_type() -> DataType
fn default_data_type() -> DataType
Returns the most obvious
DataType for the rust type.Auto Trait Implementations§
impl Freeze for VariantVal
impl RefUnwindSafe for VariantVal
impl Send for VariantVal
impl Sync for VariantVal
impl Unpin for VariantVal
impl UnsafeUnpin for VariantVal
impl UnwindSafe for VariantVal
Blanket Implementations§
impl<T> Allocation for T
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
impl<T> FromSqlOwned for Twhere
T: for<'a> FromSql<'a>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
impl<T> Key for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].impl<T> LruKey for T
impl<T> LruValue for T
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<M> MetricVecRelabelExt for M
impl<M> MetricVecRelabelExt for M
Source§fn relabel(
self,
metric_level: MetricLevel,
relabel_threshold: MetricLevel,
) -> RelabeledMetricVec<M>
fn relabel( self, metric_level: MetricLevel, relabel_threshold: MetricLevel, ) -> RelabeledMetricVec<M>
Equivalent to
RelabeledMetricVec::with_metric_level.Source§fn relabel_n(
self,
metric_level: MetricLevel,
relabel_threshold: MetricLevel,
relabel_num: usize,
) -> RelabeledMetricVec<M>
fn relabel_n( self, metric_level: MetricLevel, relabel_threshold: MetricLevel, relabel_num: usize, ) -> RelabeledMetricVec<M>
Equivalent to
RelabeledMetricVec::with_metric_level_relabel_n.Source§fn relabel_debug_1(
self,
relabel_threshold: MetricLevel,
) -> RelabeledMetricVec<M>
fn relabel_debug_1( self, relabel_threshold: MetricLevel, ) -> RelabeledMetricVec<M>
Equivalent to
RelabeledMetricVec::with_metric_level_relabel_n with metric_level set to
MetricLevel::Debug and relabel_num set to 1.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SameOrElseExt for Twhere
T: Eq,
impl<T> SameOrElseExt for Twhere
T: Eq,
Source§fn same_or_else(self, other: T, f: impl FnOnce() -> T) -> T
fn same_or_else(self, other: T, f: impl FnOnce() -> T) -> T
Check if
self and other are equal, if so, return self, otherwise return the result of f().§impl<T> Scope for T
impl<T> Scope for T
Source§impl<T> ToOwnedDatum for Twhere
T: Into<ScalarImpl>,
impl<T> ToOwnedDatum for Twhere
T: Into<ScalarImpl>,
Source§fn to_owned_datum(self) -> Option<ScalarImpl>
fn to_owned_datum(self) -> Option<ScalarImpl>
Convert the datum to an owned
Datum.§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.