pub struct PredictionClient { /* private fields */ }
Expand description
A client for interacting with ‘predictions’ endpoint
Implementations§
Source§impl PredictionClient
impl PredictionClient
Sourcepub fn from(config: ReplicateConfig) -> Self
pub fn from(config: ReplicateConfig) -> Self
Create a new PredictionClient
based upon a ReplicateConfig
object
Sourcepub async fn create(
&self,
owner: &str,
name: &str,
input: Value,
stream: bool,
) -> ReplicateResult<Prediction>
pub async fn create( &self, owner: &str, name: &str, input: Value, stream: bool, ) -> ReplicateResult<Prediction>
Create a new prediction
Sourcepub async fn get(&self, id: String) -> Result<Prediction>
pub async fn get(&self, id: String) -> Result<Prediction>
Get details for an existing prediction
Sourcepub async fn list(&self) -> Result<Predictions>
pub async fn list(&self) -> Result<Predictions>
List all existing predictions for the current user
Sourcepub async fn cancel(&self, id: String) -> Result<Prediction>
pub async fn cancel(&self, id: String) -> Result<Prediction>
Cancel an existing prediction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PredictionClient
impl RefUnwindSafe for PredictionClient
impl Send for PredictionClient
impl Sync for PredictionClient
impl Unpin for PredictionClient
impl UnwindSafe for PredictionClient
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