pub struct Hub { /* private fields */ }Expand description
A Hub client: the base URL and this node’s token.
Implementations§
Source§impl Hub
impl Hub
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
The Hub at url (such as HUB or a mirror), without a token.
Sourcepub fn with_token(self, token: Option<HfToken>) -> Self
pub fn with_token(self, token: Option<HfToken>) -> Self
Sends token with requests (gated and private repos).
pub fn url(&self) -> &str
pub fn has_token(&self) -> bool
Sourcepub fn search(&self, search: &Search) -> Result<Vec<SearchHit>>
pub fn search(&self, search: &Search) -> Result<Vec<SearchHit>>
Repos matching the search, most downloaded first.
Sourcepub fn repo_files(&self, repo: &str) -> Result<Vec<RepoFile>>
pub fn repo_files(&self, repo: &str) -> Result<Vec<RepoFile>>
The GGUF model files of repo (see repo_files).
Trait Implementations§
impl Eq for Hub
impl StructuralPartialEq for Hub
Auto Trait Implementations§
impl Forget for Hub
impl Freeze for Hub
impl Move for Hub
impl RefUnwindSafe for Hub
impl Send for Hub
impl Sync for Hub
impl Unpin for Hub
impl UnsafeUnpin for Hub
impl UnwindSafe for Hub
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