pub struct BatchBuilder { /* private fields */ }
Expand description
Batch builder for accumulating operations
Implementations§
Source§impl BatchBuilder
impl BatchBuilder
Sourcepub fn new(config: BatchBuilderConfig) -> Self
pub fn new(config: BatchBuilderConfig) -> Self
Create a new batch builder
Sourcepub fn on_flush<F>(&mut self, callback: F)
pub fn on_flush<F>(&mut self, callback: F)
Set a callback to be called when batches are flushed
Sourcepub fn insert_batch(&mut self, triples: Vec<Triple>) -> Result<(), OxirsError>
pub fn insert_batch(&mut self, triples: Vec<Triple>) -> Result<(), OxirsError>
Add multiple insert operations
Sourcepub fn query(
&mut self,
subject: Option<Subject>,
predicate: Option<Predicate>,
object: Option<Object>,
) -> Result<(), OxirsError>
pub fn query( &mut self, subject: Option<Subject>, predicate: Option<Predicate>, object: Option<Object>, ) -> Result<(), OxirsError>
Add a query operation
Sourcepub fn transform<F>(&mut self, f: F) -> Result<(), OxirsError>
pub fn transform<F>(&mut self, f: F) -> Result<(), OxirsError>
Add a transform operation
Sourcepub fn stats(&self) -> &BatchBuilderStats
pub fn stats(&self) -> &BatchBuilderStats
Get current statistics
Sourcepub fn pending_operations(&self) -> usize
pub fn pending_operations(&self) -> usize
Get the current number of pending operations
Sourcepub fn flush(&mut self) -> Result<Vec<BatchOperation>, OxirsError>
pub fn flush(&mut self) -> Result<Vec<BatchOperation>, OxirsError>
Flush all pending operations into batch operations
Auto Trait Implementations§
impl Freeze for BatchBuilder
impl !RefUnwindSafe for BatchBuilder
impl Send for BatchBuilder
impl Sync for BatchBuilder
impl Unpin for BatchBuilder
impl !UnwindSafe for BatchBuilder
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> 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