Skip to main content

Batches

Struct Batches 

Source
pub struct Batches<'a> { /* private fields */ }
Expand description

Batches resource. Workflow polling happens only on an explicit wait call.

Implementations§

Source§

impl<'a> Batches<'a>

Source

pub async fn create<'r>( &self, input: impl Into<BatchCreateInput<'r>>, idempotency_key: Option<&str>, ) -> Result<Batch, BatchOperationError>

Create from an uploaded file or from native requests (via CreateBatchFromRequests). The requests path uploads buffered JSONL and creates the batch, without polling or retries. Post-upload failure exposes a recoverable file id/key in BatchOperationError::Submission.

Source

pub async fn retrieve(&self, id: &str) -> Result<Batch, Error>

Retrieve the latest state without polling.

Source

pub async fn list( &self, options: BatchListOptions<'_>, ) -> Result<BatchPage<Batch>, Error>

Retrieve one page without automatic pagination.

Source

pub async fn cancel(&self, id: &str) -> Result<Batch, Error>

Explicitly request server cancellation; partial results may remain.

Source

pub async fn wait( &self, id: &str, options: BatchWaitOptions, ) -> Result<Batch, BatchOperationError>

Wait until completed/failed/expired/cancelled. HTTP errors propagate without retry. Timeout or dropping this future stops client-side polling, never the server batch.

Source

pub async fn results( &self, id: &str, ) -> Result<BatchResults<'a>, BatchOperationError>

Read terminal output and error files through a bounded, per-file buffered async cursor. This never waits for completion. Inspect cursor.batch() for batch-level validation errors.

Source

pub async fn results_with_options( &self, id: &str, options: BatchResultsOptions, ) -> Result<BatchResults<'a>, BatchOperationError>

Results cursor with an explicit per-file byte allowance.

Trait Implementations§

Source§

impl<'a> Clone for Batches<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Batches<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Batches<'a>

§

impl<'a> !UnwindSafe for Batches<'a>

§

impl<'a> Freeze for Batches<'a>

§

impl<'a> Send for Batches<'a>

§

impl<'a> Sync for Batches<'a>

§

impl<'a> Unpin for Batches<'a>

§

impl<'a> UnsafeUnpin for Batches<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more