pub struct RevisionLedger {
pub revision: u32,
pub revised_on: String,
pub revisions_today: u32,
pub origin: Option<String>,
}Expand description
The per-skill revision ledger stored at metadata.experience.
Fields§
§revision: u32How many times this skill has been revised. 0 = never.
revised_on: StringUTC YYYY-MM-DD of the most recent revision. Empty = never revised.
revisions_today: u32Revisions made on revised_on. Meaningless once the
date rolls over, which is precisely how the daily cap resets.
origin: Option<String>How this skill came to exist. Some("distilled") = machine-authored by
crate::experience::SkillDistiller; None = hand-written or from elsewhere.
Implementations§
Source§impl RevisionLedger
impl RevisionLedger
Sourcepub fn from_manifest(m: &SkillManifest) -> Self
pub fn from_manifest(m: &SkillManifest) -> Self
Read the ledger out of a manifest. A skill with no ledger (hand-written, or predating this feature) reads as all-zero, i.e. never revised — the permissive default, so an existing skill isn’t locked out of its first fix.
Sourcepub fn write_into(&self, m: &mut SkillManifest)
pub fn write_into(&self, m: &mut SkillManifest)
Write the ledger back into a manifest’s metadata, leaving every other
metadata key (notably metadata.harness) untouched.
Sourcepub fn bumped(&self, today: &str) -> Self
pub fn bumped(&self, today: &str) -> Self
The ledger after one more revision performed on today.
Sourcepub fn revisions_on(&self, today: &str) -> u32
pub fn revisions_on(&self, today: &str) -> u32
Revisions already made today, given today’s date. Zero once the date rolls over.
Trait Implementations§
Source§impl Clone for RevisionLedger
impl Clone for RevisionLedger
Source§impl Debug for RevisionLedger
impl Debug for RevisionLedger
Source§impl Default for RevisionLedger
impl Default for RevisionLedger
Source§impl<'de> Deserialize<'de> for RevisionLedger
impl<'de> Deserialize<'de> for RevisionLedger
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>,
impl Eq for RevisionLedger
Source§impl PartialEq for RevisionLedger
impl PartialEq for RevisionLedger
Source§impl Serialize for RevisionLedger
impl Serialize for RevisionLedger
impl StructuralPartialEq for RevisionLedger
Auto Trait Implementations§
impl Forget for RevisionLedger
impl Freeze for RevisionLedger
impl RefUnwindSafe for RevisionLedger
impl Send for RevisionLedger
impl Sync for RevisionLedger
impl Unpin for RevisionLedger
impl UnsafeUnpin for RevisionLedger
impl UnwindSafe for RevisionLedger
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.