Struct replicate_rust::model::Model
source · pub struct Model {
pub parent: Client,
pub versions: Version,
}
Fields§
§parent: Client
§versions: Version
Implementations§
source§impl Model
impl Model
Model struct contains all the functionality for interacting with the model endpoints of the Replicate API. Currently supports the following endpoint:
sourcepub fn new(rep: Client) -> Self
pub fn new(rep: Client) -> Self
Create a new Model struct.
Arguments
rep
- The client (crate::client::Client
) to use for authentication and communication.
sourcepub fn get(
&self,
model_owner: String,
model_name: String
) -> Result<GetModel, Box<dyn Error>>
pub fn get( &self, model_owner: String, model_name: String ) -> Result<GetModel, Box<dyn Error>>
Get the details of a model.
Arguments
model_owner
- The owner of the model.model_name
- The name of the model.
Example
use replicate_rust::Replicate;
let replicate = Replicate::new("api_key");
match replicate.models.get(String::from("replicate"), String::from("hello-world")) {
Ok(result) => println!("Success : {:?}", result),
Err(e) => println!("Error : {}", e),
};
Auto Trait Implementations§
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
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