Struct replicate_rust::version::Version
source · pub struct Version {
pub parent: Config,
}
Fields§
§parent: Config
Implementations§
source§impl Version
impl Version
The Version struct is used to interact with the Model Versions Endpoints.
sourcepub fn get(
&self,
model_owner: String,
model_name: String,
version_id: String
) -> Result<GetModelVersion, Box<dyn Error>>
pub fn get( &self, model_owner: String, model_name: String, version_id: String ) -> Result<GetModelVersion, Box<dyn Error>>
Get the details of a model version.
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
// Get the details of a model version.
match replicate.models.versions.get(
String::from("kvfrans"),
String::from("clipdraw"),
String::from("5797a99edc939ea0e9242d5e8c9cb3bc7d125b1eac21bda852e5cb79ede2cd9b"),
) {
Ok(result) => println!("Success : {:?}", result),
Err(e) => println!("Error : {}", e),
};
sourcepub fn list(
&self,
model_owner: String,
model_name: String
) -> Result<ListModelVersions, Box<dyn Error>>
pub fn list( &self, model_owner: String, model_name: String ) -> Result<ListModelVersions, Box<dyn Error>>
List the versions of a model.
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
// List the versions of a model.
match replicate.models.versions.list(String::from("replicate"), String::from("hello-world")) {
Ok(result) => println!("Success : {:?}", result),
Err(e) => println!("Error : {}", e),
};
Auto Trait Implementations§
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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