pub struct WriteBatchBuilder { /* private fields */ }
Expand description
Builder for writing or updating multiple records in a single request.
Implementations§
Source§impl WriteBatchBuilder
impl WriteBatchBuilder
Sourcepub fn add_record(self, record: Record) -> Self
pub fn add_record(self, record: Record) -> Self
Sourcepub fn append_record(&mut self, record: Record)
pub fn append_record(&mut self, record: Record)
Sourcepub fn add_records(self, records: Vec<Record>) -> Self
pub fn add_records(self, records: Vec<Record>) -> Self
Sourcepub fn append_records(&mut self, records: Vec<Record>)
pub fn append_records(&mut self, records: Vec<Record>)
Sourcepub fn add_timestamp_us(self, timestamp: u64) -> Self
pub fn add_timestamp_us(self, timestamp: u64) -> Self
Sourcepub fn append_timestamp_us(&mut self, timestamp: u64)
pub fn append_timestamp_us(&mut self, timestamp: u64)
Add an empty record to the batch with the given timestamp without chaining.
§Arguments
timestamp
- The UNIX timestamp in microseconds of the record.
Sourcepub fn add_timestamp(self, timestamp: SystemTime) -> Self
pub fn add_timestamp(self, timestamp: SystemTime) -> Self
Sourcepub fn append_timestamp(&mut self, timestamp: SystemTime)
pub fn append_timestamp(&mut self, timestamp: SystemTime)
Add an empty record to the batch with the given timestamp without chaining.
§Arguments
timestamp
- The timestamp of the record.
Sourcepub fn add_timestamps_us(self, timestamps: Vec<u64>) -> Self
pub fn add_timestamps_us(self, timestamps: Vec<u64>) -> Self
Sourcepub fn append_timestamps_us(&mut self, timestamps: Vec<u64>)
pub fn append_timestamps_us(&mut self, timestamps: Vec<u64>)
Add a vector of empty records to the batch with the given timestamps without chaining.
§Arguments
timestamps
- The UNIX timestamps in microseconds of the records.
Sourcepub fn add_timestamps(self, timestamps: Vec<SystemTime>) -> Self
pub fn add_timestamps(self, timestamps: Vec<SystemTime>) -> Self
Sourcepub fn append_timestamps(&mut self, timestamps: Vec<SystemTime>)
pub fn append_timestamps(&mut self, timestamps: Vec<SystemTime>)
Add an empty record to the batch with the given timestamp without chaining.
§Arguments
timestamp
- The timestamp of the record.
Sourcepub async fn send(self) -> Result<BTreeMap<u64, ReductError>, ReductError>
pub async fn send(self) -> Result<BTreeMap<u64, ReductError>, ReductError>
Sourcepub fn record_count(&self) -> usize
pub fn record_count(&self) -> usize
Get the number of records in the batch.
Sourcepub fn last_access(&self) -> SystemTime
pub fn last_access(&self) -> SystemTime
Get the last time a record was added to the batch.
Can be used for sending the batch after a certain period of time.
Auto Trait Implementations§
impl Freeze for WriteBatchBuilder
impl !RefUnwindSafe for WriteBatchBuilder
impl Send for WriteBatchBuilder
impl Sync for WriteBatchBuilder
impl Unpin for WriteBatchBuilder
impl !UnwindSafe for WriteBatchBuilder
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