pub struct Version {
pub parent: Config,
}
Expand description
Used to interact with the [Model Versions Endpoints](https://replicate.com/docs/refer ence/http#models.versions.get).
Fields§
§parent: Config
Holds a reference to a Configuration struct, which contains the base url, auth token among other settings.
Implementations§
Source§impl Version
The Version struct is used to interact with the Model Versions Endpoints.
impl Version
The Version struct is used to interact with the Model Versions Endpoints.
Sourcepub fn get(
&self,
model_owner: &str,
model_name: &str,
version_id: &str,
) -> Result<GetModelVersion, ReplicateError>
pub fn get( &self, model_owner: &str, model_name: &str, version_id: &str, ) -> Result<GetModelVersion, ReplicateError>
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.
let version = replicate.models.versions.get(
"kvfrans",
"clipdraw",
"5797a99edc939ea0e9242d5e8c9cb3bc7d125b1eac21bda852e5cb79ede2cd9b",
)?;
println!("Version : {:?}", version);
Sourcepub fn list(
&self,
model_owner: &str,
model_name: &str,
) -> Result<ListModelVersions, ReplicateError>
pub fn list( &self, model_owner: &str, model_name: &str, ) -> Result<ListModelVersions, ReplicateError>
List the versions of a model.
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
let versions = replicate.models.versions.list("replicate", "hello-world")?;
println!("Versions : {:?}", versions);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Version
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