pub enum RepoTypeAny {
Model,
Dataset,
Space,
Kernel,
}Expand description
Runtime-tagged repository kind. Holds an enum value rather than encoding the kind in the type system — useful when the kind is decided at runtime (CLI flag, config string, upstream enum) and you don’t want to thread a type parameter through downstream code.
Implements RepoType so it can be used as the type parameter on
HFRepository<RepoTypeAny>, and implements
FromStr for both singular and plural string forms
(e.g. "model", "models", "dataset", "datasets").
The trait methods (singular, plural,
url_prefix) dispatch on the held variant at runtime.
All the standard file, commit, and repo-management APIs are available on
HFRepository<RepoTypeAny> — uploads/downloads, tree listings, commit history and diffs,
branches, tags, settings, and existence checks all work identically to a typed handle and
hit the right Hub endpoint for the runtime variant. The kind-specific
HFRepository::<RepoTypeModel>::info (and its per-kind
siblings) and the Space-only runtime helpers (runtime, pause, restart, secrets,
variables, hardware, duplicate) are not available — they live on the per-kind typed
handles.
Variants§
Trait Implementations§
Source§impl Clone for RepoTypeAny
impl Clone for RepoTypeAny
Source§fn clone(&self) -> RepoTypeAny
fn clone(&self) -> RepoTypeAny
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RepoTypeAny
Source§impl Debug for RepoTypeAny
impl Debug for RepoTypeAny
Source§impl Default for RepoTypeAny
impl Default for RepoTypeAny
Source§fn default() -> RepoTypeAny
fn default() -> RepoTypeAny
Source§impl Display for RepoTypeAny
impl Display for RepoTypeAny
impl Eq for RepoTypeAny
Source§impl FromStr for RepoTypeAny
impl FromStr for RepoTypeAny
Source§impl Hash for RepoTypeAny
impl Hash for RepoTypeAny
Source§impl PartialEq for RepoTypeAny
impl PartialEq for RepoTypeAny
Source§impl RepoType for RepoTypeAny
impl RepoType for RepoTypeAny
Source§fn singular(&self) -> &'static str
fn singular(&self) -> &'static str
"model", "dataset", "space", or "kernel".
Used in logs, error messages, and the "type" field of repo create/delete/move bodies.Source§fn plural(&self) -> &'static str
fn plural(&self) -> &'static str
/api/{plural}/{repo_id} URLs:
"models", "datasets", "spaces", or "kernels".Source§fn url_prefix(&self) -> &'static str
fn url_prefix(&self) -> &'static str
<endpoint>/{prefix}{repo_id}/resolve/...):
"" for RepoTypeModel (the model namespace is unprefixed) and "<plural>/"
for the other three kinds.impl StructuralPartialEq for RepoTypeAny
Auto Trait Implementations§
impl Freeze for RepoTypeAny
impl RefUnwindSafe for RepoTypeAny
impl Send for RepoTypeAny
impl Sync for RepoTypeAny
impl Unpin for RepoTypeAny
impl UnsafeUnpin for RepoTypeAny
impl UnwindSafe for RepoTypeAny
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<E> ResultError for E
impl<T> ResultType for T
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.