pub struct PredictionsApi { /* private fields */ }
Expand description
API for managing predictions.
Implementations§
Source§impl PredictionsApi
impl PredictionsApi
Sourcepub fn new(http: HttpClient) -> Self
pub fn new(http: HttpClient) -> Self
Create a new predictions API instance.
Sourcepub async fn create(
&self,
request: CreatePredictionRequest,
) -> Result<Prediction>
pub async fn create( &self, request: CreatePredictionRequest, ) -> Result<Prediction>
Create a new prediction.
Sourcepub async fn get(&self, id: &str) -> Result<Prediction>
pub async fn get(&self, id: &str) -> Result<Prediction>
Get a prediction by ID.
Sourcepub async fn list(
&self,
cursor: Option<&str>,
) -> Result<PaginatedResponse<Prediction>>
pub async fn list( &self, cursor: Option<&str>, ) -> Result<PaginatedResponse<Prediction>>
List predictions with optional pagination.
Sourcepub async fn cancel(&self, id: &str) -> Result<Prediction>
pub async fn cancel(&self, id: &str) -> Result<Prediction>
Cancel a prediction.
Sourcepub async fn wait_for_completion(
&self,
id: &str,
max_duration: Option<Duration>,
poll_interval: Option<Duration>,
) -> Result<Prediction>
pub async fn wait_for_completion( &self, id: &str, max_duration: Option<Duration>, poll_interval: Option<Duration>, ) -> Result<Prediction>
Wait for a prediction to complete with polling.
Trait Implementations§
Source§impl Clone for PredictionsApi
impl Clone for PredictionsApi
Source§fn clone(&self) -> PredictionsApi
fn clone(&self) -> PredictionsApi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PredictionsApi
impl !RefUnwindSafe for PredictionsApi
impl Send for PredictionsApi
impl Sync for PredictionsApi
impl Unpin for PredictionsApi
impl !UnwindSafe for PredictionsApi
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