Skip to main content

App

Struct App 

Source
pub struct App {
Show 14 fields pub user_id: Uuid, pub active_tab: Tab, pub overlays: OverlayStack, pub cmdline: CmdLine, pub edit_mode: EditMode, pub status: String, pub should_quit: bool, pub console_focused: bool, pub accounts: ListTab, pub transactions: ListTab, pub commodities: ListTab, pub reports: ReportsTab, pub config: ConfigTab, pub console: ConsoleState, /* private fields */
}

Fields§

§user_id: Uuid§active_tab: Tab§overlays: OverlayStack§cmdline: CmdLine§edit_mode: EditMode§status: String§should_quit: bool§console_focused: bool

Whether the console input prompt has keyboard focus.

§accounts: ListTab§transactions: ListTab§commodities: ListTab§reports: ReportsTab§config: ConfigTab§console: ConsoleState

Implementations§

Source§

impl App

Source

pub fn submit_commodity_convert( &mut self, amount_num_denom: &str, amount_str: &str, from: &str, from_label: &str, to: &str, to_label: &str, ) -> bool

Submit a convert-amount query.

Returns false only when the eval worker has stopped.

Source§

impl App

Source

pub fn open_transaction_edit_async(&mut self, id: &str)

Dispatch (get-transaction-detail "<id>") with RouteCtx::TransactionEdit.

The async reply opens the edit form (or sets a status on parse failure).

Source

pub fn submit_transaction_edit( &mut self, id: &str, splits: &[LogicalSplitInput], note: &str, date: &str, ) -> bool

Submit the update-transaction-logical payload for the edit form.

Returns false when the eval worker is absent or the payload fails to build.

Source§

impl App

Source

pub fn fetch_report( &mut self, kind: ReportKind, from: &str, to: &str, chart: &str, )

Submit a report fetch for the given kind + date range + chart shape.

Source

pub fn submit_console_form(&mut self, form: String)

Source

pub fn interrupt_console(&self)

Source

pub fn drain_eval(&mut self)

Source

pub fn drain_console(&mut self)

Source

pub fn refresh_tab(&mut self, tab: Tab)

Source

pub fn fetch_config(&mut self)

Source

pub fn submit_config_set(&mut self, key: &str, value: &str) -> bool

Source

pub fn submit_commodity_create(&mut self, symbol: &str, name: &str) -> bool

Submit a create-commodity mutation. Returns false only if the eval worker has stopped.

Source

pub fn submit_account_create( &mut self, name: &str, parent: Option<&str>, ) -> bool

Submit a create-account mutation. Returns false only if the eval worker has stopped.

Source

pub fn submit_transaction_create( &mut self, splits: &[LogicalSplitInput], note: &str, date: &str, ) -> bool

Submit a create-transaction-logical mutation. Returns false only if the eval worker has stopped or the payload fails to build.

Source§

impl App

Source

pub fn fetch_account_form_options(&mut self)

Issue a list-accounts fetch to populate the parent Select in the open account-create form. Bumps form_options_seq so a stale reply is dropped.

Source

pub fn fetch_transaction_form_options(&mut self)

Issue list-accounts + list-commodities to populate the Selects in the open transaction-create/edit form. Both requests share the same seq.

Source

pub fn fetch_commodity_convert_form_options(&mut self)

Issue a list-commodities fetch to populate the two Selects in the open commodity-convert form. Bumps form_options_seq so a stale reply is dropped.

Source§

impl App

Source

pub fn submit_delete_transaction(&mut self, id: &str) -> bool

Submit a delete-transaction mutation. Returns false only if the eval worker has stopped.

Source

pub fn submit_account_tag( &mut self, account_id: &str, name: &str, value: &str, ) -> bool

Submit a set-account-tag mutation. Returns false only if the eval worker has stopped.

Source

pub fn submit_transaction_tag( &mut self, transaction_id: &str, name: &str, value: &str, ) -> bool

Submit a set-transaction-tag mutation. Returns false only if the eval worker has stopped.

Source§

impl App

Source

pub fn new(user_id: Uuid, edit_mode: EditMode) -> Self

Source

pub fn active_view(&self) -> ViewRef<'_>

Source

pub fn active_view_mut(&mut self) -> ViewMut<'_>

Source

pub fn queue_chart(&mut self, spec: ChartSpec)

Source

pub fn take_pending_chart(&mut self) -> Option<ChartSpec>

Source

pub fn next_tab(&mut self)

Source

pub fn previous_tab(&mut self)

Source

pub fn switch_tab(&mut self, tab: Tab)

Source

pub fn open_command_line(&mut self)

Source

pub fn close_command_line(&mut self)

Source

pub fn set_status(&mut self, msg: impl Into<String>)

Source

pub fn request_quit(&mut self)

Source

pub fn set_edit_mode(&mut self, mode: EditMode)

Source

pub fn attach_console(&mut self, eval: ConsoleEval)

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl !UnwindSafe 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,