Skip to main content

App

Struct App 

Source
pub struct App {
Show 31 fields pub phase: Phase, pub screen: Screen, pub focus: Focus, pub input: Option<CurrentEu4Input>, pub selectable: bool, pub excluded: BTreeSet<String>, pub source_path: Option<PathBuf>, pub mod_scroll: usize, pub filter: Option<MergeDisposition>, pub query: String, pub selected: usize, pub detail_scroll: u16, pub input_pane: InputPane, pub mod_detail_scroll: u16, pub issues_scroll: u16, pub hit: Cell<HitAreas>, pub settings: AnalysisSettings, pub analyzed_with: Option<(AnalysisSettings, BTreeSet<String>)>, pub game_base_available: bool, pub options: Option<usize>, pub confirming_exclusions: bool, pub confirming_build: bool, pub refusal: Option<String>, pub notice: Option<String>, pub effect: Option<Effect>, pub mouse_capture: bool, pub help: bool, pub drag_anchor: Option<Position>, pub selection: Option<(Position, Position)>, pub selection_bounds: Rect, pub copy_selection: bool, /* private fields */
}
Expand description

The browser’s whole visible state. It only reads: no key leads to a decision, an artifact, or a write.

Fields§

§phase: Phase§screen: Screen§focus: Focus§input: Option<CurrentEu4Input>§selectable: bool

Whether the current input snapshot can still be analyzed with some selection of its mods. Each snapshot is analyzed at most once.

§excluded: BTreeSet<String>

Mods, by playset id, the user left out of the next analysis. Kept across refreshes; ids no longer in the playset are ignored.

§source_path: Option<PathBuf>

The INPUT_SOURCE foch merge takes for this input, or None for the current EU4 playset.

§mod_scroll: usize§filter: Option<MergeDisposition>§query: String§selected: usize

Index into App::visible_units.

§detail_scroll: u16§input_pane: InputPane

The focused panel of the playset screen.

§mod_detail_scroll: u16§issues_scroll: u16§hit: Cell<HitAreas>

Filled in by each frame; read by mouse handling.

§settings: AnalysisSettings§analyzed_with: Option<(AnalysisSettings, BTreeSet<String>)>

The settings and exclusions of the analysis being run or browsed.

§game_base_available: bool

Whether the input source can supply the EU4 base as an ancestor.

§options: Option<usize>

Cursor row while the options panel is open.

§confirming_exclusions: bool

Asking whether to analyze without the excluded mods.

§confirming_build: bool

Asking whether to build base data, which writes Foch’s data directory.

§refusal: Option<String>

Why the last key could not do what it asks, until the next key.

§notice: Option<String>

What the last key did, until the next key.

§effect: Option<Effect>

Waiting for the run loop to carry it out.

§mouse_capture: bool§help: bool§drag_anchor: Option<Position>

Where the left button went down, while it is held.

§selection: Option<(Position, Position)>

The screen cells a drag covers, from where it started to where it is; highlighted, and copied when the button is released.

§selection_bounds: Rect

The inside of the panel the drag started in: a selection never leaves it, so it copies only that panel’s text and no borders.

§copy_selection: bool

The finished selection is waiting to be copied from the next frame.

Implementations§

Source§

impl App

Source

pub fn analysis(&self) -> Option<&AnalysisView>

Source

pub fn effective_settings(&self) -> AnalysisSettings

The settings an analysis started now would use.

Source

pub fn settings_changed(&self) -> bool

Whether the options or exclusions changed since the browsed analysis ran.

Source

pub fn mods(&self) -> &[DetectedPlaysetMod]

Source

pub fn is_excluded(&self, playset_mod: &DetectedPlaysetMod) -> bool

Source

pub fn effective_exclusions(&self) -> BTreeSet<String>

The exclusions that name a mod of the current playset.

Source

pub fn excluded_positions(&self) -> BTreeSet<usize>

Playset positions of the excluded mods, as input preparation takes them.

Source

pub fn problem_mods(&self) -> Vec<&DetectedPlaysetMod>

Mods that cannot be analyzed and are not excluded yet.

Source

pub fn included_count(&self) -> usize

Source

pub fn needs_base_data(&self) -> bool

Whether the analysis would use the game base while its base data is not ready.

Source

pub fn can_analyze(&self) -> bool

Source

pub fn data_build_args(&self) -> Option<DataBuildArgs>

The foch data build arguments B runs: the inspected EU4 installation, installed into Foch’s data directory.

Source

pub fn merge_args(&self, out: PathBuf) -> MergeArgs

The foch merge arguments of the analysis a runs. The browser analyzes through exactly these, writing nothing, so cli_command reproduces its analysis.

Source

pub fn cli_command(&self) -> String

The foch command that runs the analysis a would run, so a script or agent can reproduce it without the browser.

Source

pub fn is_working(&self) -> bool

Source

pub fn visible_units(&self) -> Vec<usize>

Indices of the units that pass the disposition filter and the query, in review order.

Source

pub fn selected_unit(&self) -> Option<&MergeUnitOutcome>

Source

pub fn handle_key(&mut self, key: KeyEvent) -> Option<AppCommand>

Source

pub fn focused_text(&self) -> String

The text of the focused panel, for c.

Source

pub fn handle_mouse(&mut self, mouse: MouseEvent)

A click focuses the panel under the pointer and, in a list, selects the row; the wheel scrolls the panel under the pointer. Mouse input is ignored while a dialog is open.

Trait Implementations§

Source§

impl Debug for App

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Sync for App

§

impl Send 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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> Instrument for T

Source§

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

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

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

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
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> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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 = !

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

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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