pub struct GatewayBatch { /* private fields */ }Expand description
A gateway batch job over an input file, with status and per-request counts.
Implementations§
Source§impl GatewayBatch
impl GatewayBatch
Sourcepub fn new(
id: impl Into<String>,
input_file_id: impl Into<String>,
endpoint: impl Into<String>,
created_at_ms: u64,
request_counts: GatewayBatchCounts,
) -> Self
pub fn new( id: impl Into<String>, input_file_id: impl Into<String>, endpoint: impl Into<String>, created_at_ms: u64, request_counts: GatewayBatchCounts, ) -> Self
Creates a new batch in the GatewayBatchStatus::Queued state.
Sourcepub fn complete(
self,
output_file_id: Option<String>,
error_file_id: Option<String>,
completed_at_ms: u64,
request_counts: GatewayBatchCounts,
) -> Self
pub fn complete( self, output_file_id: Option<String>, error_file_id: Option<String>, completed_at_ms: u64, request_counts: GatewayBatchCounts, ) -> Self
Returns the batch transitioned to GatewayBatchStatus::Completed with
the given output/error files, completion time, and final counts.
Sourcepub fn cancel(self, cancelled_at_ms: u64) -> Self
pub fn cancel(self, cancelled_at_ms: u64) -> Self
Returns the batch transitioned to GatewayBatchStatus::Cancelled,
counting any still-queued requests as cancelled.
Sourcepub fn input_file_id(&self) -> &str
pub fn input_file_id(&self) -> &str
Returns the id of the input file backing this batch.
Sourcepub fn status(&self) -> &GatewayBatchStatus
pub fn status(&self) -> &GatewayBatchStatus
Returns the current lifecycle status.
Sourcepub fn output_file_id(&self) -> Option<&str>
pub fn output_file_id(&self) -> Option<&str>
Returns the output file id, once the batch has produced one.
Sourcepub fn error_file_id(&self) -> Option<&str>
pub fn error_file_id(&self) -> Option<&str>
Returns the error file id, if the batch produced one.
Sourcepub fn created_at_ms(&self) -> u64
pub fn created_at_ms(&self) -> u64
Returns the creation timestamp in milliseconds since the Unix epoch.
Sourcepub fn completed_at_ms(&self) -> Option<u64>
pub fn completed_at_ms(&self) -> Option<u64>
Returns the completion timestamp in milliseconds, if completed.
Sourcepub fn cancelled_at_ms(&self) -> Option<u64>
pub fn cancelled_at_ms(&self) -> Option<u64>
Returns the cancellation timestamp in milliseconds, if cancelled.
Sourcepub fn request_counts(&self) -> GatewayBatchCounts
pub fn request_counts(&self) -> GatewayBatchCounts
Returns the current per-request counts.
Trait Implementations§
Source§impl Clone for GatewayBatch
impl Clone for GatewayBatch
Source§fn clone(&self) -> GatewayBatch
fn clone(&self) -> GatewayBatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GatewayBatch
impl Debug for GatewayBatch
impl Eq for GatewayBatch
Source§impl PartialEq for GatewayBatch
impl PartialEq for GatewayBatch
impl StructuralPartialEq for GatewayBatch
Auto Trait Implementations§
impl Freeze for GatewayBatch
impl RefUnwindSafe for GatewayBatch
impl Send for GatewayBatch
impl Sync for GatewayBatch
impl Unpin for GatewayBatch
impl UnsafeUnpin for GatewayBatch
impl UnwindSafe for GatewayBatch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.