pub struct EntryKey {
pub model_name: String,
pub revision: Option<String>,
pub metadata_only: bool,
}Expand description
The components a registry key is built from.
Fields§
§model_name: StringProvider-canonical model name.
revision: Option<String>Immutable revision the request resolved to, when the provider has one.
metadata_only: boolWhether the entry covers a weightless (config/tokenizer only) download.
Implementations§
Source§impl EntryKey
impl EntryKey
pub fn new( model_name: impl Into<String>, revision: Option<String>, metadata_only: bool, ) -> Self
Sourcepub fn parse(key: &str) -> Self
pub fn parse(key: &str) -> Self
Recover the components of an encoded key.
A key without the prefix parses back to an unpinned, full-weight entry, which is how records written before revisions existed are read.
Sourcepub fn belongs_to(&self, model_name: &str) -> bool
pub fn belongs_to(&self, model_name: &str) -> bool
True when this entry belongs to model_name, whatever its revision or weight mode.
Drives “forget everything about this model” operations such as model clear.
Trait Implementations§
impl Eq for EntryKey
impl StructuralPartialEq for EntryKey
Auto Trait Implementations§
impl Forget for EntryKey
impl Freeze for EntryKey
impl Move for EntryKey
impl RefUnwindSafe for EntryKey
impl Send for EntryKey
impl Sync for EntryKey
impl Unpin for EntryKey
impl UnsafeUnpin for EntryKey
impl UnwindSafe for EntryKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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.