pub struct AppState {Show 18 fields
pub app: App,
pub snapshot: Snapshot,
pub profile: Option<String>,
pub source: ListSource,
pub visible: Vec<usize>,
pub list: ListState,
pub focus: Focus,
pub mode: Mode,
pub view_scroll: u16,
pub content_lines: usize,
pub content_cache: HashMap<Uuid, Rendered>,
pub cmdline: CmdLine,
pub expand: bool,
pub message: Option<(Level, String)>,
pub stale_warned: bool,
pub quit: bool,
pub list_height: u16,
pub view_height: u16,
}Fields§
§app: App§snapshot: Snapshot§profile: Option<String>Profile scope; None = all profiles.
source: ListSource§visible: Vec<usize>Indices into snapshot.rows: current source ∩ profile scope.
list: ListState§focus: Focus§mode: Mode§view_scroll: u16§content_lines: usizePre-wrap line count of the selected jot’s content.
content_cache: HashMap<Uuid, Rendered>§cmdline: CmdLine§expand: boolTransclusion in the content view (x toggles): expanded
content comes from cuj’s show –expand path.
message: Option<(Level, String)>§stale_warned: boolThe stale-index warning fires once per snapshot.
quit: bool§list_height: u16Viewport heights, updated by the draw pass.
view_height: u16Implementations§
Source§impl AppState
impl AppState
pub fn new(app: App) -> Result<AppState>
pub fn scope(&self) -> Option<&str>
Sourcepub fn recompute_visible(&mut self)
pub fn recompute_visible(&mut self)
Rebuild visible from source ∩ scope and clamp selection.
pub fn selected_row(&self) -> Option<&JotRow>
Sourcepub fn select_index(&mut self, i: usize)
pub fn select_index(&mut self, i: usize)
Select by position in visible, resetting the view scroll.
Sourcepub fn select_entry(&mut self, entry: Uuid) -> bool
pub fn select_entry(&mut self, entry: Uuid) -> bool
Select the row holding entry, if visible.
pub fn set_message(&mut self, level: Level, text: impl Into<String>)
Sourcepub fn ensure_content(&mut self)
pub fn ensure_content(&mut self)
Load the selected jot’s content into the cache (head-only,
so Vault::get_bytes suffices — no transient Reads needed),
highlighted under its profile’s parser configuration, and
clamp the view scroll. Called once per loop iteration,
before drawing.
pub fn content_of(&self, entry: Uuid) -> Option<&Rendered>
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl !Sync for AppState
impl !UnwindSafe for AppState
impl Send for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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