pub struct Capability {
pub level: ColorLevel,
pub width: u16,
pub is_tty: bool,
pub unicode: bool,
pub background: Background,
}Expand description
The full capability wall — carried by the environment, never the block.
Fields§
§level: ColorLevel§width: u16Terminal width in columns, clamped to a sane band.
is_tty: bool§unicode: bool§background: BackgroundImplementations§
Source§impl Capability
impl Capability
Sourcepub fn probe() -> Capability
pub fn probe() -> Capability
Probe the real environment through a sealed precedence fold
(mirrors shikumi::resolve_progressive): CLICOLOR_FORCE >
NO_COLOR > !is_tty > COLORTERM > TERM > none.
pub fn probe_stream(stream: Stream) -> Capability
Sourcepub const fn plain() -> Capability
pub const fn plain() -> Capability
The pipe/NO_COLOR/test floor: zero SGR, ASCII, 80 columns.
Sourcepub const fn fixed(level: ColorLevel, width: u16, unicode: bool) -> Capability
pub const fn fixed(level: ColorLevel, width: u16, unicode: bool) -> Capability
A fixed capability for tests/mocks at a chosen depth.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Capability
Source§impl Debug for Capability
impl Debug for Capability
impl Eq for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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
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§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
Compare self to
key and return true if they are equal.