Skip to main content

RenderSettings

Struct RenderSettings 

Source
pub struct RenderSettings { /* private fields */ }
Expand description

The output features selected for one render operation.

The default is deliberately dumb: no escape-sequence-producing feature is selected. A terminal’s detected maximum can be adopted with From and then narrowed with the named setters.

Implementations§

Source§

impl RenderSettings

Source

pub const fn all() -> Self

Selects every rendering feature without degrading logical styles.

This is intended for serializers whose styles have already been narrowed to the output’s capabilities. Ordinary terminal output should detect capabilities and convert them with From.

Source

pub const fn get_color_level(self) -> ColorLevel

Source

pub const fn get_attributes(self) -> TextAttributes

Source

pub const fn get_underline_styles(self) -> UnderlineStyleSet

Source

pub const fn get_underline_colors(self) -> bool

Source

pub const fn color_level(self, color_level: ColorLevel) -> Self

Source

pub const fn attributes(self, attributes: TextAttributes) -> Self

Source

pub const fn underline_styles(self, styles: UnderlineStyleSet) -> Self

Source

pub const fn underline_colors(self, enabled: bool) -> Self

Source

pub const fn reset_color_level(self) -> Self

Source

pub const fn reset_attributes(self) -> Self

Source

pub const fn reset_underline_styles(self) -> Self

Source

pub const fn reset_underline_colors(self) -> Self

Source

pub fn resolve_text_style(self, style: &TextStyle) -> TextStyle

Applies these selected features to one logical text style.

This is useful to output backends that serialize runs themselves, such as an interactive prompt renderer. Ordinary static output should call render for the whole resolved view.

Trait Implementations§

Source§

impl Clone for RenderSettings

Source§

fn clone(&self) -> RenderSettings

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 Debug for RenderSettings

Source§

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

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

impl Default for RenderSettings

Source§

fn default() -> RenderSettings

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

impl From<TerminalCapabilities> for RenderSettings

Source§

fn from(capabilities: TerminalCapabilities) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RenderSettings

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for RenderSettings

Source§

impl Eq for RenderSettings

Source§

impl StructuralPartialEq for RenderSettings

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<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> 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.