#[non_exhaustive]pub enum ResourceKind {
Http,
Hub {
provider: HubProvider,
repo: String,
repo_type: HubRepoType,
revision: String,
},
BitTorrent {
source: BitTorrentSource,
name: Option<String>,
},
Custom {
protocol: String,
},
}Expand description
Protocol family a Resource is fetched with.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Http
A direct HTTP(S) download.
Hub
A repository snapshot from a model hub.
Fields
§
provider: HubProviderHub service hosting the repository.
§
repo_type: HubRepoTypeWhether the repository is a model or a dataset.
BitTorrent
A torrent, given as a magnet link or a .torrent file.
Fields
§
source: BitTorrentSourceWhere the torrent metadata comes from.
Custom
A third-party protocol selected by a custom parser and consumed by a
custom DownloadBackend.
protocol is matched by the backend’s supports method; protocol
data belongs in Resource::metadata and
ResourceFile::metadata.
Trait Implementations§
Source§impl Clone for ResourceKind
impl Clone for ResourceKind
Source§impl Debug for ResourceKind
impl Debug for ResourceKind
Source§impl<'de> Deserialize<'de> for ResourceKind
impl<'de> Deserialize<'de> for ResourceKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for ResourceKind
impl Freeze for ResourceKind
impl Move for ResourceKind
impl RefUnwindSafe for ResourceKind
impl Send for ResourceKind
impl Sync for ResourceKind
impl Unpin for ResourceKind
impl UnsafeUnpin for ResourceKind
impl UnwindSafe for ResourceKind
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