Struct mz_storage_client::util::antichain::MutableOffsetAntichain
source · pub struct MutableOffsetAntichain {
inner: MutableAntichain<PartitionOffset>,
}
Expand description
A wrapper around MutableAntichain
that allows adding (inserting all
contents with a +1
) and subtracting (inserting all contents with a -1
)
of whole OffsetAntichains
.
The frontier of this mutable antichain can be revealed in the form of an
OffsetAntichain
.
Fields§
§inner: MutableAntichain<PartitionOffset>
Implementations§
source§impl MutableOffsetAntichain
impl MutableOffsetAntichain
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new, empty MutableOffsetAntichain
.
sourcepub fn add(&mut self, offsets: &OffsetAntichain)
pub fn add(&mut self, offsets: &OffsetAntichain)
Inserts all partition/offset pairs contained in the given
OffsetAntichain
into this MutableOffsetAntichain
, with a diff
of +1
.
In laymans terms, this adds the contained partition/offset pairs.
sourcepub fn subtract(&mut self, offsets: &OffsetAntichain)
pub fn subtract(&mut self, offsets: &OffsetAntichain)
Inserts all partition/offset pairs contained in the given
OffsetAntichain
into this MutableOffsetAntichain
, with a diff
of -1
.
In laymans terms, this subtracts the contained partition/offset pairs.
pub fn update_iter<I>(&mut self, updates: I)where
I: IntoIterator<Item = ((PartitionId, MzOffset), Diff)>,
sourcepub fn frontier(&self) -> OffsetAntichain
pub fn frontier(&self) -> OffsetAntichain
Reveals the minimal elements with positive count.
In laymans terms, this returns an OffsetAntichain
that contains all
partitions with positive counts, and their respective minimal offset.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MutableOffsetAntichain
impl Send for MutableOffsetAntichain
impl Sync for MutableOffsetAntichain
impl Unpin for MutableOffsetAntichain
impl UnwindSafe for MutableOffsetAntichain
Blanket Implementations§
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.