pub struct ScmPanel {Show 22 fields
pub open: bool,
pub message: String,
pub focus: ScmFocus,
pub selected: usize,
pub staged: Vec<ScmEntry>,
pub changes: Vec<ScmEntry>,
pub branch: String,
pub ahead: u32,
pub behind: u32,
pub graph: Vec<GraphRow>,
pub graph_selected: usize,
pub graph_limit: usize,
pub root: Option<PathBuf>,
pub error: Option<String>,
pub last_result: Option<String>,
pub opened_at: Option<Instant>,
pub anim_pending: bool,
pub anim_from: f32,
pub anim_to: f32,
pub closing: bool,
pub just_closed: bool,
pub graph_pending: bool,
}Fields§
§open: bool§message: String§focus: ScmFocus§selected: usizeSelected index in the flattened changes list (staged first, then unstaged)
staged: Vec<ScmEntry>§changes: Vec<ScmEntry>§branch: String§ahead: u32§behind: u32§graph: Vec<GraphRow>Pretty commit graph rows (newest first)
graph_selected: usizeSelected commit in the graph (when focus is Graph)
graph_limit: usizeHow many commits to request from git log (grows with load-more)
root: Option<PathBuf>§error: Option<String>§last_result: Option<String>§opened_at: Option<Instant>Animation clock — armed on open/close, started by the first render so
synchronous git status / git log refresh can’t eat the window.
anim_pending: bool§anim_from: f32Openness at phase start / end (0 = off-screen, 1 = fully visible).
anim_to: f32§closing: boolTrue while a close animation is playing (open stays true until done).
just_closed: boolSet for one frame when the close animation settles (app clears mode).
graph_pending: boolDefer expensive graph layout until first paint (open feels instant).
Implementations§
Source§impl ScmPanel
impl ScmPanel
pub fn new() -> Self
pub fn is_animating(&self) -> bool
Sourcepub fn close_immediate(&mut self)
pub fn close_immediate(&mut self)
Instant hide (no animation) — used when switching to another overlay.
Sourcepub fn open_and_refresh(&mut self, hint_path: Option<&Path>)
pub fn open_and_refresh(&mut self, hint_path: Option<&Path>)
Open and refresh against repo containing hint_path (or cwd).
Sourcepub fn refresh_status(&mut self, hint_path: Option<&Path>)
pub fn refresh_status(&mut self, hint_path: Option<&Path>)
Status/branch/changes only — no git log / graph layout.
Sourcepub fn ensure_graph(&mut self)
pub fn ensure_graph(&mut self)
Load graph if deferred (call from UI once per open).
Sourcepub fn anim_progress(&mut self) -> f32
pub fn anim_progress(&mut self) -> f32
Linear openness 0.0..=1.0 (0 = off-screen, 1 = fully shown). Easing is applied in the UI. First call after arming starts the clock.
Sourcepub fn take_just_closed(&mut self) -> bool
pub fn take_just_closed(&mut self) -> bool
Returns true once when a close animation has settled.
pub fn total_files(&self) -> usize
pub fn entry_at(&self, idx: usize) -> Option<&ScmEntry>
pub fn clamp_selected(&mut self)
pub fn move_sel(&mut self, delta: isize)
pub fn refresh(&mut self, hint_path: Option<&Path>)
Sourcepub fn load_more_graph(&mut self) -> Result<usize, String>
pub fn load_more_graph(&mut self) -> Result<usize, String>
Fetch more history (double limit, capped). Call while graph is focused.
pub fn move_graph_sel(&mut self, delta: isize)
pub fn selected_graph_row(&self) -> Option<&GraphRow>
Sourcepub fn stage_selected(&mut self) -> Result<(), String>
pub fn stage_selected(&mut self) -> Result<(), String>
Stage the selected file (or all unstaged if none selected / with all).
pub fn stage_all(&mut self) -> Result<(), String>
pub fn unstage_all(&mut self) -> Result<(), String>
pub fn discard_selected(&mut self) -> Result<(), String>
Sourcepub fn commit(&mut self, amend: bool) -> Result<(), String>
pub fn commit(&mut self, amend: bool) -> Result<(), String>
Commit staged changes with current message. If nothing staged, stage all first (VS Code default often requires staged; we match VS Code “Commit” on staged only unless message + commit all shortcut).
pub fn cycle_focus(&mut self, forward: bool)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScmPanel
impl RefUnwindSafe for ScmPanel
impl Send for ScmPanel
impl Sync for ScmPanel
impl Unpin for ScmPanel
impl UnsafeUnpin for ScmPanel
impl UnwindSafe for ScmPanel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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