pub struct Api { /* private fields */ }
Expand description
The actual Api used to interacto with the hub.
You can inspect repos with [Api::info
]
or download files with [Api::download
]
Implementations§
source§impl Api
impl Api
sourcepub fn new() -> Result<Self, ApiError>
pub fn new() -> Result<Self, ApiError>
Creates a default Api, for Api options See ApiBuilder
sourcepub fn client(&self) -> &HeaderAgent
pub fn client(&self) -> &HeaderAgent
Get the underlying api client Allows for lower level access
sourcepub fn model(&self, model_id: String) -> ApiRepo
pub fn model(&self, model_id: String) -> ApiRepo
Simple wrapper over
let api = Api::new().unwrap();
let api = api.repo(Repo::new(model_id, RepoType::Model));
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Api
impl Send for Api
impl Sync for Api
impl Unpin for Api
impl !UnwindSafe for Api
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