pub struct StashStack {
pub version: u32,
pub entries: Vec<StashEntry>,
}Expand description
The stash stack containing all stash entries
Fields§
§version: u32Schema version for forward compatibility
entries: Vec<StashEntry>Stash entries, ordered by index (0 = most recent)
Implementations§
Source§impl StashStack
impl StashStack
pub const VERSION: u32 = 1
Sourcepub fn get(&self, index: u32) -> Option<&StashEntry>
pub fn get(&self, index: u32) -> Option<&StashEntry>
Get a stash entry by index
Sourcepub fn push(
&mut self,
commit_cid: CommitCid,
original_head: CommitCid,
message: Option<String>,
)
pub fn push( &mut self, commit_cid: CommitCid, original_head: CommitCid, message: Option<String>, )
Push a new entry onto the stack
This shifts all existing indices up by 1.
Sourcepub fn remove(&mut self, index: u32) -> Option<StashEntry>
pub fn remove(&mut self, index: u32) -> Option<StashEntry>
Remove and return an entry by index
Entries with higher indices are shifted down.
Trait Implementations§
Source§impl Clone for StashStack
impl Clone for StashStack
Source§fn clone(&self) -> StashStack
fn clone(&self) -> StashStack
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StashStack
impl Debug for StashStack
Source§impl Default for StashStack
impl Default for StashStack
Source§impl<'de> Deserialize<'de> for StashStack
impl<'de> Deserialize<'de> for StashStack
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 StashStack
impl RefUnwindSafe for StashStack
impl Send for StashStack
impl Sync for StashStack
impl Unpin for StashStack
impl UnsafeUnpin for StashStack
impl UnwindSafe for StashStack
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more