pub struct MapRef<'a>(ListRef<'a>);
Expand description
A map is just a slice of the underlying struct array.
Refer to MapArray
for the invariants of a map value.
XXX: perhaps we can make it MapRef<'a, 'b>(ListRef<'a>, ListRef<'b>);
.
Then we can build a map ref from 2 list refs without copying the data.
Currently it’s impossible.
https://github.com/risingwavelabs/risingwave/issues/17863
Tuple Fields§
§0: ListRef<'a>
Implementations§
source§impl<'a> MapRef<'a>
impl<'a> MapRef<'a>
sourcepub unsafe fn new_unchecked(list: ListRef<'a>) -> Self
pub unsafe fn new_unchecked(list: ListRef<'a>) -> Self
§Safety
The caller must ensure the invariants of a map value.
pub fn inner(&self) -> &ListRef<'a>
pub fn into_inner(self) -> ListRef<'a>
pub fn into_kv(self) -> (ListRef<'a>, ListRef<'a>)
pub fn keys(&self) -> HashSet<ScalarRefImpl<'_>>
pub fn to_owned(self) -> MapValue
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
source§impl<'a> MapRef<'a>
impl<'a> MapRef<'a>
sourcepub fn iter(
self,
) -> impl DoubleEndedIterator + ExactSizeIterator<Item = (ScalarRefImpl<'a>, DatumRef<'a>)> + 'a
pub fn iter( self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = (ScalarRefImpl<'a>, DatumRef<'a>)> + 'a
Iterates over the elements of the map.
pub fn iter_struct( self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = StructRef<'a>> + 'a
pub fn iter_sorted( self, ) -> impl DoubleEndedIterator + ExactSizeIterator<Item = (ScalarRefImpl<'a>, DatumRef<'a>)> + 'a
sourcepub fn memcmp_serialize(
self,
serializer: &mut Serializer<impl BufMut>,
) -> Result<()>
pub fn memcmp_serialize( self, serializer: &mut Serializer<impl BufMut>, ) -> Result<()>
Note: Map should not be used as key. But we don’t want to panic.
See MapArray
for the semantics. See also the Ord
implementation.
TODO: ban it in fe https://github.com/risingwavelabs/risingwave/issues/7981
Trait Implementations§
source§impl<'scalar> From<MapRef<'scalar>> for ScalarRefImpl<'scalar>
impl<'scalar> From<MapRef<'scalar>> for ScalarRefImpl<'scalar>
source§impl Ord for MapRef<'_>
impl Ord for MapRef<'_>
source§impl PartialOrd for MapRef<'_>
impl PartialOrd for MapRef<'_>
source§impl<'a> ScalarRef<'a> for MapRef<'a>
impl<'a> ScalarRef<'a> for MapRef<'a>
source§type ScalarType = MapValue
type ScalarType = MapValue
ScalarType
is the owned type of current ScalarRef
.source§fn to_owned_scalar(&self) -> MapValue
fn to_owned_scalar(&self) -> MapValue
Convert
ScalarRef
to an owned scalar.source§fn hash_scalar<H: Hasher>(&self, state: &mut H)
fn hash_scalar<H: Hasher>(&self, state: &mut H)
A wrapped hash function to get the hash value for this scaler.
source§impl SelfAsScalarRef for MapRef<'_>
impl SelfAsScalarRef for MapRef<'_>
fn as_scalar_ref(&self) -> Self
source§impl ToText for MapRef<'_>
impl ToText for MapRef<'_>
source§fn write<W: Write>(&self, f: &mut W) -> Result
fn write<W: Write>(&self, f: &mut W) -> Result
Write the text to the writer regardless of its data type Read more
source§fn write_with_type<W: Write>(&self, ty: &DataType, f: &mut W) -> Result
fn write_with_type<W: Write>(&self, ty: &DataType, f: &mut W) -> Result
Write the text to the writer according to its data type
source§fn to_text_with_type(&self, ty: &DataType) -> String
fn to_text_with_type(&self, ty: &DataType) -> String
Convert to text according to its data type
source§impl<'scalar> TryFrom<ScalarRefImpl<'scalar>> for MapRef<'scalar>
impl<'scalar> TryFrom<ScalarRefImpl<'scalar>> for MapRef<'scalar>
source§type Error = ArrayError
type Error = ArrayError
The type returned in the event of a conversion error.
source§fn try_from(val: ScalarRefImpl<'scalar>) -> ArrayResult<Self>
fn try_from(val: ScalarRefImpl<'scalar>) -> ArrayResult<Self>
Performs the conversion.
impl<'a> Copy for MapRef<'a>
impl<'a> Eq for MapRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for MapRef<'a>
impl<'a> RefUnwindSafe for MapRef<'a>
impl<'a> Send for MapRef<'a>
impl<'a> Sync for MapRef<'a>
impl<'a> Unpin for MapRef<'a>
impl<'a> UnwindSafe for MapRef<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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<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<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.