pub struct FooterDataProvider { /* private fields */ }Expand description
Matches pi’s FooterDataProvider — provides git branch, extension
statuses, and provider count to the Footer on a pull basis.
Owned by the App behind Rc<RefCell<>>. The Footer holds a shared
Rc clone and reads data each render cycle instead of receiving
push updates from the App.
Git branch resolution:
- Walk up from
cwdlooking for.git - If
.gitis a file → worktree: parsegitdir:path, find HEAD - If
.gitis a directory → regular repo: find HEAD - Read HEAD file; if
ref: refs/heads/.invalid→ fall back to git - Otherwise treat as detached HEAD
Implementations§
pub fn new(cwd: PathBuf) -> Self
pub fn get_git_branch(&self) -> Option<&str>
Sourcepub fn refresh_git_branch(&mut self)
pub fn refresh_git_branch(&mut self)
Re-resolve git branch from disk (e.g. after a known branch switch).
pub fn set_cwd(&mut self, cwd: PathBuf)
pub fn get_extension_statuses(&self) -> &BTreeMap<String, String>
pub fn set_extension_status(&mut self, key: &str, text: Option<&str>)
pub fn clear_extension_statuses(&mut self)
pub fn get_available_provider_count(&self) -> usize
pub fn set_available_provider_count(&mut self, count: usize)
Auto Trait Implementations§
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