pub struct EventBatchBuilder { /* private fields */ }Expand description
Incremental builder for a columnar EventBatch.
Implementations§
Source§impl EventBatchBuilder
impl EventBatchBuilder
Sourcepub fn with_capacity(schema: Arc<Schema>, capacity: usize) -> Self
pub fn with_capacity(schema: Arc<Schema>, capacity: usize) -> Self
Creates an empty builder with per-column capacity.
Sourcepub fn push<P, S>(&mut self, p4s: P, scalars: S) -> LadduDataResult<&mut Self>
pub fn push<P, S>(&mut self, p4s: P, scalars: S) -> LadduDataResult<&mut Self>
Appends an unweighted event from ordered values.
§Errors
Returns LadduDataError when value counts do not match the schema or
the builder already contains weighted events.
Sourcepub fn push_weighted<P, S>(
&mut self,
p4s: P,
scalars: S,
weight: f64,
) -> LadduDataResult<&mut Self>
pub fn push_weighted<P, S>( &mut self, p4s: P, scalars: S, weight: f64, ) -> LadduDataResult<&mut Self>
Appends a weighted event from ordered values.
§Errors
Returns LadduDataError when value counts do not match the schema or
the builder already contains unweighted events.
Sourcepub fn push_event(&mut self, event: OwnedEvent) -> LadduDataResult<&mut Self>
pub fn push_event(&mut self, event: OwnedEvent) -> LadduDataResult<&mut Self>
Validates and appends one owned event.
§Errors
Returns LadduDataError when the event shape does not match the
schema or its weight presence differs from prior events.
Sourcepub fn extend<I>(&mut self, events: I) -> LadduDataResult<&mut Self>where
I: IntoIterator<Item = OwnedEvent>,
pub fn extend<I>(&mut self, events: I) -> LadduDataResult<&mut Self>where
I: IntoIterator<Item = OwnedEvent>,
Appends all owned events from an iterator.
§Errors
Returns the first LadduDataError produced by an event whose shape or
weight presence is incompatible with the builder.
Sourcepub fn finish(self) -> LadduDataResult<EventBatch>
pub fn finish(self) -> LadduDataResult<EventBatch>
Finalizes the builder into an immutable batch.
§Errors
Returns LadduDataError if the accumulated columns or weights have
inconsistent lengths.
Auto Trait Implementations§
impl Freeze for EventBatchBuilder
impl RefUnwindSafe for EventBatchBuilder
impl Send for EventBatchBuilder
impl Sync for EventBatchBuilder
impl Unpin for EventBatchBuilder
impl UnsafeUnpin for EventBatchBuilder
impl UnwindSafe for EventBatchBuilder
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.