pub struct State { /* private fields */ }Implementations§
Source§impl State
impl State
pub fn load(path: &Path) -> Result<Self>
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Atomic write: temp file in the same directory, then rename over the target.
pub fn get(&self, key: &ReviewKey) -> Option<&ReviewEntry>
pub fn insert(&mut self, entry: ReviewEntry)
pub fn remove(&mut self, key: &ReviewKey) -> Option<ReviewEntry>
pub fn iter(&self) -> impl Iterator<Item = &ReviewEntry>
pub fn workspace(&self, stack_id: &str) -> Option<&Workspace>
Sourcepub fn workspace_of(&self, entry: &ReviewEntry) -> Option<&Workspace>
pub fn workspace_of(&self, entry: &ReviewEntry) -> Option<&Workspace>
The workspace entry is checked out in, if any.
pub fn workspace_for(&self, key: &ReviewKey) -> Option<&Workspace>
pub fn workspaces(&self) -> impl Iterator<Item = (&String, &Workspace)>
pub fn insert_workspace(&mut self, stack_id: String, ws: Workspace)
pub fn remove_workspace(&mut self, stack_id: &str) -> Option<Workspace>
Sourcepub fn members_of(&self, stack_id: &str) -> Vec<ReviewKey>
pub fn members_of(&self, stack_id: &str) -> Vec<ReviewKey>
Every tracked review checked out in stack_id’s workspace.
Sourcepub fn for_each_entry_mut(&mut self, f: impl FnMut(&mut ReviewEntry))
pub fn for_each_entry_mut(&mut self, f: impl FnMut(&mut ReviewEntry))
Apply f to every entry (used to detach/attach stack membership in bulk).
Sourcepub fn find_by_prefix<'a>(&'a self, prefix: &str) -> Vec<&'a ReviewEntry>
pub fn find_by_prefix<'a>(&'a self, prefix: &str) -> Vec<&'a ReviewEntry>
Matches from the front of id ("D123" -> "D12345"), from the front of id’s last
/-delimited segment (GitHub ids are owner/repo/number, so "123" -> ".../123" -
otherwise there’d be no way to find a PR by the number you’d actually remember, since it
sits at the end, not the start), or an exact source/id slug.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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