Skip to main content

App

Struct App 

Source
pub struct App {
Show 13 fields pub pane: Pane, pub detail_tab: DetailTab, pub focus: Focus, pub rows: Vec<BoardRow>, pub selected: usize, pub project: Option<String>, pub projects: Vec<String>, pub detail: Option<IssueDetail>, pub detail_body: String, pub prompt: Option<(PromptKind, String)>, pub confirm: Option<ConfirmKind>, pub help: bool, pub clipboard: String, /* private fields */
}
Expand description

Interactive board. Talks only to BoardBackend.

Fields§

§pane: Pane

Active list pane.

§detail_tab: DetailTab

Detail pane tab (show / excerpt / tree / related).

§focus: Focus

Whether keys target the row list or the detail pane.

§rows: Vec<BoardRow>

Rows for the current pane.

§selected: usize

Index into Self::rows.

§project: Option<String>

Project filter, if any.

§projects: Vec<String>

Known project names for the p prompt.

§detail: Option<IssueDetail>

Last loaded issue detail, if any.

§detail_body: String

Text drawn in the detail pane.

§prompt: Option<(PromptKind, String)>

Open line prompt and its buffer.

§confirm: Option<ConfirmKind>

Pending DONE/CANCELLED confirmation.

§help: bool

Help overlay is visible.

§clipboard: String

Last id copied with y.

Implementations§

Source§

impl App

Source

pub fn open_core(layout: Layout, agent: String) -> Result<Self, Error>

Open a file-backed board and load the Ready pane.

§Errors

Returns an error if the vault cannot be parsed or the first pane cannot be loaded.

Source

pub fn with_backend( backend: Box<dyn BoardBackend>, agent: String, status: ServeStatus, ) -> Result<Self, Error>

Build a board around an existing backend and load the Ready pane.

§Errors

Returns an error if the first pane cannot be loaded.

Source

pub fn serve_status(&self) -> ServeStatus

How the status line labels the current store.

Source

pub fn agent(&self) -> &str

Identity used for claims and updates.

Source

pub fn generation(&self) -> u64

Catalog generation from the current backend.

Source

pub fn revision(&self) -> u64

Serve revision from the current backend. Core is always 0.

Source

pub fn selected_id(&self) -> Option<&str>

Id of the selected row, if the pane is not empty.

Source

pub fn selected_state(&self) -> Option<&str>

Org state of the selected row, if the pane is not empty.

Source

pub fn backend(&self) -> &dyn BoardBackend

The store this board is talking to.

Source

pub fn replace_backend( &mut self, backend: Box<dyn BoardBackend>, status: ServeStatus, )

Swap the store and adopt its identity. Does not reload rows.

Source

pub fn attach( &mut self, socket: &Path, offline: bool, hooks: &AttachHooks, ) -> Result<(), Error>

Post-paint attach. --offline never probes the socket.

§Errors

Returns an error if the pane cannot be reloaded after the attach attempt.

Source

pub fn status_line(&self) -> String

One-line serve: / gen / rev / agent / project / message summary.

Source

pub fn reload(&mut self) -> Result<(), Error>

Fetch the current pane from the backend and refresh detail.

§Errors

Returns an error if the backend cannot load the pane.

Source

pub fn poll_updates(&mut self)

Wait briefly for a catalog change and reload when the watermark moves.

Source

pub fn handle_key(&mut self, key: KeyEvent) -> Action

Dispatch one key. Repeat and press count; release is ignored.

Source

pub fn prompt_line(&self) -> Option<String>

Label and buffer for the open prompt, if any.

Source

pub fn confirm_line(&self) -> Option<String>

Confirmation line for DONE/CANCELLED, if any.

Source

pub fn help_text(&self) -> &'static str

Text drawn on ?.

Trait Implementations§

Source§

impl Debug for App

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for App

§

impl !UnwindSafe for App

§

impl Freeze for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.