pub struct Repo { /* private fields */ }
Expand description
The representation of a repo on the hub.
Implementations§
Source§impl Repo
impl Repo
Sourcepub fn new(repo_id: String, repo_type: RepoType) -> Self
pub fn new(repo_id: String, repo_type: RepoType) -> Self
Repo with the default branch (“main”).
Sourcepub fn with_revision(
repo_id: String,
repo_type: RepoType,
revision: String,
) -> Self
pub fn with_revision( repo_id: String, repo_type: RepoType, revision: String, ) -> Self
fully qualified Repo
Sourcepub fn model(repo_id: String) -> Self
pub fn model(repo_id: String) -> Self
Shortcut for Repo::new
with RepoType::Model
Sourcepub fn dataset(repo_id: String) -> Self
pub fn dataset(repo_id: String) -> Self
Shortcut for Repo::new
with RepoType::Dataset
Sourcepub fn space(repo_id: String) -> Self
pub fn space(repo_id: String) -> Self
Shortcut for Repo::new
with RepoType::Space
Sourcepub fn folder_name(&self) -> String
pub fn folder_name(&self) -> String
The normalized folder nameof the repo within the cache directory
Sourcepub fn url_revision(&self) -> String
pub fn url_revision(&self) -> String
Revision needs to be url escaped before being used in a URL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl Sync for Repo
impl Unpin for Repo
impl UnwindSafe for Repo
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