Skip to main content

AsgScratchStore

Struct AsgScratchStore 

Source
pub struct AsgScratchStore<'a> {
    pub repo: &'a Repository,
}
Expand description

ScratchStore backed by an ASG Repository.

Fields§

§repo: &'a Repository

Trait Implementations§

Source§

impl<'a> ScratchStore for AsgScratchStore<'a>

Source§

fn write_entry( &self, ref_name: &str, entry: &ScratchEntry, agent_id: &str, ) -> Result<ScratchEntry>

Persist a new scratch entry. Returns the stored entry (may have updated_at refreshed by the impl).
Source§

fn read_entry(&self, ref_name: &str, scratch_id: &str) -> Result<ScratchEntry>

Read a single entry by scratch_id.
Source§

fn update_entry( &self, ref_name: &str, scratch_id: &str, content: &str, agent_id: &str, ) -> Result<ScratchEntry>

Replace the content of an existing draft entry and refresh updated_at.
Source§

fn list_entries( &self, ref_name: &str, filter: &ScratchFilter, ) -> Result<Vec<ScratchEntry>>

List entries matching the filter, newest first.
Source§

fn discard_entry( &self, ref_name: &str, scratch_id: &str, agent_id: &str, ) -> Result<()>

Transition status to Discarded. No data is deleted; the entry remains until clean_entries removes it.
Source§

fn mark_promoted( &self, ref_name: &str, scratch_id: &str, ledger_entry_id: &str, agent_id: &str, ) -> Result<ScratchEntry>

Transition status to Promoted and record which ledger entry it became. The caller is responsible for creating the ledger entry first.
Source§

fn clean_entries( &self, ref_name: &str, filter: &CleanFilter, dry_run: bool, ) -> Result<usize>

Permanently delete entries matching the filter. Returns the number of entries removed (0 when dry_run is true).

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for AsgScratchStore<'a>

§

impl<'a> !UnwindSafe for AsgScratchStore<'a>

§

impl<'a> Freeze for AsgScratchStore<'a>

§

impl<'a> Send for AsgScratchStore<'a>

§

impl<'a> Sync for AsgScratchStore<'a>

§

impl<'a> Unpin for AsgScratchStore<'a>

§

impl<'a> UnsafeUnpin for AsgScratchStore<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.