pub struct JsonbVal(pub(crate) Value);Tuple Fields§
§0: ValueImplementations§
Source§impl JsonbVal
impl JsonbVal
Create a JsonbVal from a string, with special handling for Debezium’s unavailable value placeholder.
Returns a Result to handle parsing errors properly.
Source§impl JsonbVal
impl JsonbVal
Sourcepub fn empty_array() -> Self
pub fn empty_array() -> Self
Returns an empty array [].
Sourcepub fn empty_object() -> Self
pub fn empty_object() -> Self
Returns an empty array {}.
Sourcepub fn memcmp_deserialize(
deserializer: &mut Deserializer<impl Buf>,
) -> Result<Self>
pub fn memcmp_deserialize( deserializer: &mut Deserializer<impl Buf>, ) -> Result<Self>
Deserialize from a memcomparable encoding.
Sourcepub fn value_deserialize(buf: &[u8]) -> Option<Self>
pub fn value_deserialize(buf: &[u8]) -> Option<Self>
Deserialize from a pgwire “BINARY” encoding.
Sourcepub fn take(self) -> Value
pub fn take(self) -> Value
Convert the value to a serde_json::Value.
Trait Implementations§
Source§impl Display for JsonbVal
The display of JsonbVal is pg-compatible format which has slightly different from
serde_json::Value.
impl Display for JsonbVal
The display of JsonbVal is pg-compatible format which has slightly different from
serde_json::Value.
Source§impl EstimateSize for JsonbVal
impl EstimateSize for JsonbVal
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<JsonbVal> for ScalarImpl
impl From<JsonbVal> for ScalarImpl
Source§impl FromIterator<JsonbVal> for JsonbArray
impl FromIterator<JsonbVal> for JsonbArray
Source§impl<'a> FromSql<'a> for JsonbVal
impl<'a> FromSql<'a> for JsonbVal
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 HashKeyDe for JsonbVal
impl HashKeyDe for JsonbVal
fn deserialize(data_type: &DataType, buf: impl Buf) -> Self
Source§impl Ord for JsonbVal
impl Ord for JsonbVal
Source§impl PartialOrd for JsonbVal
impl PartialOrd for JsonbVal
Source§impl Scalar for JsonbVal
impl Scalar for JsonbVal
Source§type ScalarRefType<'a> = JsonbRef<'a>
type ScalarRefType<'a> = JsonbRef<'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 ToSql for JsonbVal
impl ToSql for JsonbVal
Source§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be converted to the specified
Postgres
Type.Source§fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
An adaptor method used internally by Rust-Postgres. Read more
Source§fn to_sql(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn to_sql(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Converts the value of
self into the binary format of the specified
Postgres Type, appending it to out. Read more§fn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Specify the encode format
Source§impl TryFrom<ScalarImpl> for JsonbVal
impl TryFrom<ScalarImpl> for JsonbVal
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<'a> WithDataType for &'a JsonbVal
impl<'a> WithDataType for &'a JsonbVal
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 JsonbVal
impl<'a> WithDataType for &'a mut JsonbVal
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<JsonbVal>
impl WithDataType for Box<JsonbVal>
Source§fn default_data_type() -> DataType
fn default_data_type() -> DataType
Returns the most obvious
DataType for the rust type.Source§impl WithDataType for JsonbVal
impl WithDataType for JsonbVal
Source§fn default_data_type() -> DataType
fn default_data_type() -> DataType
Returns the most obvious
DataType for the rust type.impl Eq for JsonbVal
impl StructuralPartialEq for JsonbVal
Auto Trait Implementations§
impl Freeze for JsonbVal
impl RefUnwindSafe for JsonbVal
impl Send for JsonbVal
impl Sync for JsonbVal
impl Unpin for JsonbVal
impl UnwindSafe for JsonbVal
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
§impl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
§fn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to
self as a ToSql trait object.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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§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>
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.