pub struct KeyParts {
pub owner: Option<Arc<str>>,
pub kind: Option<Arc<str>>,
pub label: Arc<str>,
pub generation: Option<u64>,
}Expand description
A key’s parts, by the grammar every key the tree mints follows:
[<owner>/]<name>[#<generation>] where <name> is [<kind>:]<label>golden/tool:add#2 is owner golden, kind tool, label add,
generation 2; host/note is owner host, no kind, label note;
model:fast is no owner, kind model, label fast. The owner is the
text before the first /, the kind the text before the first : of
what follows, the generation the digits after the last #; a label
holds anything else, so a key whose label contains one of those
separators is read as its grammar says, not as its author meant. The
string is the wire form; this is how a reader takes it apart without
a hand parser of its own.
Fields§
§owner: Option<Arc<str>>The program or host the key belongs to (golden, host).
kind: Option<Arc<str>>The family-shaped prefix of the name (model, tool, retrieve).
label: Arc<str>The name proper: a model label, a tool name, memory, note.
generation: Option<u64>The disambiguating generation (#2): the same tool registered
again under a fresh key. Only canonical u64 decimal suffixes are
generations; leading zeroes and overflow remain literal label text.
Implementations§
Trait Implementations§
impl Eq for KeyParts
impl StructuralPartialEq for KeyParts
Auto Trait Implementations§
impl Freeze for KeyParts
impl RefUnwindSafe for KeyParts
impl Send for KeyParts
impl Sync for KeyParts
impl Unpin for KeyParts
impl UnsafeUnpin for KeyParts
impl UnwindSafe for KeyParts
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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> 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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> 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.