pub struct Commit {
pub selected: bool,
/* private fields */
}Expand description
A graph item representing a commit in the smartlog output. It can be selected and deselected.
Fields§
§selected: boolImplementations§
Source§impl Commit
impl Commit
pub fn new(parsed_lines: Vec<Vec<String>>, selected: bool) -> Self
Sourcepub fn hash(&self) -> Option<&str>
pub fn hash(&self) -> Option<&str>
Get the hash of this commit which can be used for operations such as sl goto <hash>
let commit_lines = vec![
vec![" @ ", "\u{1b}[0;35m", "\u{1b}[0;93;1m", "1cee5d55e", "\u{1b}[0m", "\u{1b}[0;35m", " Dec 08 at 09:46 royrothenberg ", "\u{1b}[0;36m", "#780 Closed", "\u{1b}[0m", "\u{1b}[0;35m", " ", "\u{1b}[0;31m", "✗", "\u{1b}[0m"],
vec![" │ ", "\u{1b}[0;35m", "[pr body update] update stack list without overwriting PR title and body", "\u{1b}[0m"],
].iter().map(|x| x.iter().map(|x| x.to_string()).collect()).collect();
let commit = Commit::new(commit_lines, true);
assert_eq!(commit.hash().unwrap(), "1cee5d55e");pub fn select(&mut self)
pub fn deselect(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Commit
impl RefUnwindSafe for Commit
impl Send for Commit
impl Sync for Commit
impl Unpin for Commit
impl UnwindSafe for Commit
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