Skip to main content

Placed

Struct Placed 

Source
pub struct Placed {
    pub columns: Option<Columns>,
    pub heading: Option<Rect>,
    pub rows: Rect,
    pub map: Option<Rect>,
    pub notice: Option<Rect>,
    pub scroll: usize,
    pub overlay: Option<Rect>,
    pub answers: Option<[Rect; 2]>,
}
Expand description

Where the last frame put everything a pointer can aim at.

Read back from the layout draw produced rather than described a second time. A hard-coded row-to-y map would be one line out the first time the header or the heading changed height, and being one line out here presses a row nobody chose — on a screen whose keys delete directories.

Default is a frame that was never drawn, on which every press resolves to Spot::Nowhere. That is the honest answer for the first mouse event of a run and for a test that has not painted: a synthetic geometry would be a second layout, which is the thing this type exists to avoid.

Fields§

§columns: Option<Columns>

The tree’s columns, or None on a frame that drew no tree.

§heading: Option<Rect>

The heading line, when the pane was tall enough to spend a row on one.

§rows: Rect

The body rows.

§map: Option<Rect>

Where the treemap’s image goes, when the pane is up. None is a frame with no map on it, which is every frame in a terminal that cannot draw one.

§notice: Option<Rect>

The footer, on a frame where it was saying what just happened. None whenever there is nothing to dismiss — which is what keeps a press on the ordinary footer a miss.

The whole line, though a notice no longer has the whole line to itself: a removal’s position and the session’s freed total share it. Both are figures rather than buttons, so a press that lands on one has nothing of its own to do, and giving it the dismissal beats making a reader aim at a sentence whose length they did not choose.

§scroll: usize

Which row of the tree the top drawn row held.

Recorded rather than re-read from the view, so a press maps y to a row through the offset the rows were drawn at — a sync between the frame and the press would otherwise shift every row by the difference.

§overlay: Option<Rect>

The topmost overlay’s box, in the ranking super::state::View::overlay uses. One slot, because a press lands on one thing.

§answers: Option<[Rect; 2]>

A confirmation’s two answers, in Answer::ALL order, where they were drawn.

Inside overlay and checked first. None whenever no question was on the frame — which is what a press made before the box appeared lands on, and is the whole of what stops such a press from answering one. See super::keymap::finish.

Trait Implementations§

Source§

impl Clone for Placed

Source§

fn clone(&self) -> Placed

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Placed

Source§

impl Debug for Placed

Source§

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

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

impl Default for Placed

Source§

fn default() -> Placed

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

impl Eq for Placed

Source§

impl PartialEq for Placed

Source§

fn eq(&self, other: &Placed) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Placed

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.