pub struct MapEnvironment {
pub vars: BTreeMap<String, String>,
pub terminal: bool,
pub size: Option<(usize, usize)>,
pub windows: bool,
pub cell_pixels: Option<(u16, u16)>,
}Expand description
A deterministic environment for tests and CI.
Fields§
§vars: BTreeMap<String, String>§terminal: bool§size: Option<(usize, usize)>§windows: bool§cell_pixels: Option<(u16, u16)>The cell size in pixels the terminal reports, if any.
Implementations§
Source§impl MapEnvironment
impl MapEnvironment
Sourcepub fn cell_pixels(self, width: u16, height: u16) -> Self
pub fn cell_pixels(self, width: u16, height: u16) -> Self
Set the cell size in pixels the terminal reports.
Trait Implementations§
Source§impl Clone for MapEnvironment
impl Clone for MapEnvironment
Source§impl Debug for MapEnvironment
impl Debug for MapEnvironment
Source§impl Default for MapEnvironment
impl Default for MapEnvironment
Source§impl Environment for MapEnvironment
impl Environment for MapEnvironment
Source§fn var(&self, name: &str) -> Option<String>
fn var(&self, name: &str) -> Option<String>
An environment variable,
None when unset or not Unicode.Source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
Whether stdout is a terminal.
Source§fn size(&self) -> Option<(usize, usize)>
fn size(&self) -> Option<(usize, usize)>
The terminal size in cells
(width, height), when known.Source§fn is_windows(&self) -> bool
fn is_windows(&self) -> bool
Whether this is Windows (core assumes truecolor there).
Source§fn cell_pixels(&self) -> Option<(u16, u16)>
fn cell_pixels(&self) -> Option<(u16, u16)>
The size of one cell in pixels
(width, height), when the terminal
reports its window size in pixels. Used by
GraphicsEnvironment.Auto Trait Implementations§
impl Freeze for MapEnvironment
impl RefUnwindSafe for MapEnvironment
impl Send for MapEnvironment
impl Sync for MapEnvironment
impl Unpin for MapEnvironment
impl UnsafeUnpin for MapEnvironment
impl UnwindSafe for MapEnvironment
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
Mutably borrows from an owned value. Read more