pub struct AsgScratchStore<'a> {
pub repo: &'a Repository,
}Expand description
ScratchStore backed by an ASG Repository.
Fields§
§repo: &'a RepositoryTrait Implementations§
Source§impl<'a> ScratchStore for AsgScratchStore<'a>
impl<'a> ScratchStore for AsgScratchStore<'a>
Source§fn write_entry(
&self,
ref_name: &str,
entry: &ScratchEntry,
agent_id: &str,
) -> Result<ScratchEntry>
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>
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>
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>>
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<()>
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>
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>
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> 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