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 duplicate 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 Freeze for Collection
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