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
impl Maps
Sourcepub fn why(self) -> Option<&'static str>
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§
impl Copy for Maps
impl Eq for Maps
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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