Skip to main content

Maps

Enum Maps 

Source
pub enum Maps {
    Can,
    Unread,
    Unmeasured,
}
Expand description

Whether a map can appear in this terminal right now, and when it cannot, why.

One answer, because there were two and they were asked at different times. The allowlist was read before the layout and the pixel size at the draw, so a terminal that passed the first and failed the second cost the tree its columns and then had nothing drawn in them. Neither gate was wrong; only one of them was visible to the layout.

The case that separates them is a multiplexer carrying the outer terminal’s TERM through — tmux with default-terminal "xterm-ghostty", which is what a workspace manager sets up. super::chrome::Decor then reads Ghostty and says yes, and tmux forwards no pixel fields at all, so the winsize reads zero. A bare TERM=tmux-256color never got this far: the allowlist refuses it, which is Maps::Unread and a different sentence.

So this is the only predicate the layout reads, and it carries the reason with it, because a bool would take the pane away and leave nobody able to say why it went.

Variants§

§

Can

The terminal reads the protocol and says how big its cells are.

§

Unread

It is not known to read the graphics protocol. The default, because a view nobody has told anything to has not been told this either.

§

Unmeasured

It reads the protocol but reports no pixel size.

Named for crate::size::Size::Unmeasured and for the same reason: there is no honest cell size to be had here, and the answer to an absent measurement is to say it is absent rather than to assume 8×16 and draw an image at the wrong scale over the text it is meant to sit beside.

Implementations§

Source§

impl Maps

Source

pub fn can(self) -> bool

Whether a map can be drawn.

Source

pub fn why(self) -> Option<&'static str>

The one line for a reader who wanted a map there cannot be, or None when there can.

Two sentences and not one, because the two refusals have different answers: a terminal off the allowlist is the wrong terminal, where a terminal reporting no pixel size is usually the right one with a multiplexer in between — and that is something the reader can act on.

Trait Implementations§

Source§

impl Clone for Maps

Source§

fn clone(&self) -> Maps

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 Maps

Source§

impl Debug for Maps

Source§

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

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

impl Default for Maps

Source§

fn default() -> Maps

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

impl Eq for Maps

Source§

impl PartialEq for Maps

Source§

fn eq(&self, other: &Maps) -> 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 Maps

Auto Trait Implementations§

§

impl Freeze for Maps

§

impl RefUnwindSafe for Maps

§

impl Send for Maps

§

impl Sync for Maps

§

impl Unpin for Maps

§

impl UnsafeUnpin for Maps

§

impl UnwindSafe for Maps

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.