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
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.