Struct replicate_rust::collection::Collection
source · pub struct Collection {
pub parent: Config,
}
Expand description
Used to interact with the Collection Endpoints.
Fields§
§parent: Config
Holds a reference to a Config struct, which contains the base url, auth token among other settings.
Implementations§
source§impl Collection
impl Collection
sourcepub fn get(
&self,
collection_slug: &str
) -> Result<GetCollectionModels, ReplicateError>
pub fn get( &self, collection_slug: &str ) -> Result<GetCollectionModels, ReplicateError>
Get a collection by slug.
Example
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
let collections = replicate.collections.get("audio-generation")?;
println!("Collections : {:?}", collections);
sourcepub fn list(&self) -> Result<ListCollectionModels, ReplicateError>
pub fn list(&self) -> Result<ListCollectionModels, ReplicateError>
List all collections present in Replicate.
Example
use replicate_rust::{Replicate, config::Config};
let config = Config::default();
let replicate = Replicate::new(config);
let collections = replicate.collections.list()?;
println!("Collections : {:?}", collections);
Trait Implementations§
source§impl Clone for Collection
impl Clone for Collection
source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
Returns a copy 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 RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl UnwindSafe for Collection
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