Skip to main content

SettingsState

Struct SettingsState 

Source
pub struct SettingsState {
Show 30 fields pub pages: Vec<SettingsPage>, pub selected_category: usize, pub selected_item: usize, pub focus: FocusManager<FocusPanel>, pub footer_button_index: usize, pub pending_changes: HashMap<String, Value>, pub visible: bool, pub search_query: String, pub search_active: bool, pub search_results: Vec<SearchResult>, pub selected_search_result: usize, pub search_scroll_offset: usize, pub search_max_visible: usize, pub showing_confirm_dialog: bool, pub confirm_dialog_selection: usize, pub confirm_dialog_hover: Option<usize>, pub showing_reset_dialog: bool, pub reset_dialog_selection: usize, pub reset_dialog_hover: Option<usize>, pub showing_help: bool, pub scroll_panel: ScrollablePanel, pub sub_focus: Option<usize>, pub editing_text: bool, pub hover_position: Option<(u16, u16)>, pub hover_hit: Option<SettingsHit>, pub entry_dialog_stack: Vec<EntryDialogState>, pub target_layer: ConfigLayer, pub layer_sources: HashMap<String, ConfigLayer>, pub pending_deletions: HashSet<String>, pub layout_width: u16, /* private fields */
}
Expand description

The state of the settings UI

Fields§

§pages: Vec<SettingsPage>

Pages built from categories

§selected_category: usize

Currently selected category index

§selected_item: usize

Currently selected item index within the category

§focus: FocusManager<FocusPanel>

Which panel currently has keyboard focus

§footer_button_index: usize

Selected footer button index (0=Reset, 1=Save, 2=Cancel)

§pending_changes: HashMap<String, Value>

Pending changes (path -> new value)

§visible: bool

Whether the settings panel is visible

§search_query: String

Current search query

§search_active: bool

Whether search is active

§search_results: Vec<SearchResult>

Current search results

§selected_search_result: usize

Selected search result index

§search_scroll_offset: usize

Scroll offset for search results (first visible result index)

§search_max_visible: usize

Maximum number of visible search results (set during render)

§showing_confirm_dialog: bool

Whether the unsaved changes confirmation dialog is showing

§confirm_dialog_selection: usize

Selected option in confirmation dialog (0=Save, 1=Discard, 2=Cancel)

§confirm_dialog_hover: Option<usize>

Hovered option in confirmation dialog (for mouse hover feedback)

§showing_reset_dialog: bool

Whether the reset confirmation dialog is showing

§reset_dialog_selection: usize

Selected option in reset dialog (0=Reset, 1=Cancel)

§reset_dialog_hover: Option<usize>

Hovered option in reset dialog (for mouse hover feedback)

§showing_help: bool

Whether the help overlay is showing

§scroll_panel: ScrollablePanel

Scrollable panel for settings items

§sub_focus: Option<usize>

Sub-focus index within the selected item (for TextList/Map navigation)

§editing_text: bool

Whether we’re in text editing mode (for TextList controls)

§hover_position: Option<(u16, u16)>

Current mouse hover position (for hover feedback)

§hover_hit: Option<SettingsHit>

Current hover hit result (computed from hover_position and cached layout)

§entry_dialog_stack: Vec<EntryDialogState>

Stack of entry dialogs (for nested editing of Maps/ObjectArrays) The top of the stack (last element) is the currently active dialog.

§target_layer: ConfigLayer

Which configuration layer to save changes to. User layer is the default (global settings). Project layer saves to the current project’s .fresh/config.json.

§layer_sources: HashMap<String, ConfigLayer>

Source layer for each setting path (where the value came from). Maps JSON pointer paths (e.g., “/editor/tab_size”) to their source layer. Values not in this map come from system defaults.

§pending_deletions: HashSet<String>

Paths to be removed from the current layer on save. When a user “resets” a setting, we remove it from the delta rather than setting it to the schema default.

§layout_width: u16

Last known layout width for description wrapping. Set during render and propagated to items for height calculations.

Implementations§

Source§

impl SettingsState

Source

pub fn new(schema_json: &str, config: &Config) -> Result<Self, Error>

Create a new settings state from schema and current config

Source

pub fn focus_panel(&self) -> FocusPanel

Get the currently focused panel

Source

pub fn show(&mut self)

Show the settings panel

Source

pub fn hide(&mut self)

Hide the settings panel

Source

pub fn entry_dialog(&self) -> Option<&EntryDialogState>

Get the current entry dialog (top of stack), if any

Source

pub fn entry_dialog_mut(&mut self) -> Option<&mut EntryDialogState>

Get the current entry dialog mutably (top of stack), if any

Source

pub fn has_entry_dialog(&self) -> bool

Check if any entry dialog is open

Source

pub fn current_page(&self) -> Option<&SettingsPage>

Get the currently selected page

Source

pub fn current_page_mut(&mut self) -> Option<&mut SettingsPage>

Get the currently selected page mutably

Source

pub fn current_item(&self) -> Option<&SettingItem>

Get the currently selected item

Source

pub fn current_item_mut(&mut self) -> Option<&mut SettingItem>

Get the currently selected item mutably

Source

pub fn can_exit_text_editing(&self) -> bool

Check if the current text field can be exited (valid JSON if required)

Source

pub fn entry_dialog_can_exit_text_editing(&self) -> bool

Check if entry dialog’s current text field can be exited (valid JSON if required)

Source

pub fn select_prev(&mut self)

Move selection up

Source

pub fn select_next(&mut self)

Move selection down

Source

pub fn select_next_page(&mut self)

Move selection down by a page (viewport height worth of items)

Source

pub fn select_prev_page(&mut self)

Move selection up by a page (viewport height worth of items)

Source

pub fn toggle_focus(&mut self)

Switch focus between panels: Categories -> Settings -> Footer -> Categories

Source

pub fn toggle_focus_backward(&mut self)

Switch focus to the previous panel: Categories <- Settings <- Footer <- Categories

Source

pub fn update_layout_widths(&mut self)

Ensure the selected item is visible in the viewport Update layout_width on all items in the current page. Called before any scroll calculations so heights are correct.

Source

pub fn ensure_visible(&mut self)

Source

pub fn set_pending_change(&mut self, path: &str, value: Value)

Record a pending change for a setting

Source

pub fn has_changes(&self) -> bool

Check if there are unsaved changes

Source

pub fn apply_changes(&self, config: &Config) -> Result<Config, Error>

Apply pending changes to a config

Source

pub fn discard_changes(&mut self)

Discard all pending changes

Source

pub fn set_target_layer(&mut self, layer: ConfigLayer)

Set the target layer for saving changes.

Source

pub fn cycle_target_layer(&mut self)

Cycle through writable layers: User -> Project -> Session -> User

Source

pub fn target_layer_name(&self) -> &'static str

Get a display name for the current target layer.

Source

pub fn set_layer_sources(&mut self, sources: HashMap<String, ConfigLayer>)

Set the layer sources map (called by Editor when opening settings). This also rebuilds pages to update modified indicators.

Source

pub fn get_layer_source(&self, path: &str) -> ConfigLayer

Get the source layer for a setting path. Returns the layer where this value was defined, or System if it’s the default.

Source

pub fn layer_source_label(layer: ConfigLayer) -> &'static str

Get a short label for a layer source (for UI display).

Source

pub fn reset_current_to_default(&mut self)

Reset the current item by removing it from the target layer.

NEW SEMANTICS: Instead of setting to schema default, we remove the value from the current layer’s delta. The value then falls back to inherited (from lower-precedence layers) or to the schema default.

Only items defined in the target layer can be reset.

Source

pub fn on_value_changed(&mut self)

Handle a value change from user interaction

Source

pub fn update_focus_states(&mut self)

Update focus states for rendering

Start search mode

Cancel search mode

Source

pub fn set_search_query(&mut self, query: String)

Update search query and refresh results

Source

pub fn search_push_char(&mut self, c: char)

Add a character to the search query

Source

pub fn search_pop_char(&mut self)

Remove the last character from the search query

Source

pub fn search_prev(&mut self)

Navigate to previous search result

Source

pub fn search_next(&mut self)

Navigate to next search result

Source

pub fn search_scroll_up(&mut self, delta: usize) -> bool

Scroll search results up by delta items

Source

pub fn search_scroll_down(&mut self, delta: usize) -> bool

Scroll search results down by delta items

Source

pub fn search_scroll_to_ratio(&mut self, ratio: f32) -> bool

Scroll search results to a ratio (0.0 = top, 1.0 = bottom)

Source

pub fn jump_to_search_result(&mut self)

Jump to the currently selected search result

Source

pub fn current_search_result(&self) -> Option<&SearchResult>

Get the currently selected search result

Source

pub fn show_confirm_dialog(&mut self)

Show the unsaved changes confirmation dialog

Source

pub fn hide_confirm_dialog(&mut self)

Hide the confirmation dialog

Source

pub fn confirm_dialog_next(&mut self)

Move to next option in confirmation dialog

Source

pub fn confirm_dialog_prev(&mut self)

Move to previous option in confirmation dialog

Source

pub fn toggle_help(&mut self)

Toggle the help overlay

Source

pub fn hide_help(&mut self)

Hide the help overlay

Source

pub fn showing_entry_dialog(&self) -> bool

Check if the entry dialog is showing

Source

pub fn open_entry_dialog(&mut self)

Open the entry dialog for the currently focused map entry

Source

pub fn open_add_entry_dialog(&mut self)

Open entry dialog for adding a new entry (with empty key)

Source

pub fn open_add_array_item_dialog(&mut self)

Open dialog for adding a new array item

Source

pub fn open_edit_array_item_dialog(&mut self)

Open dialog for editing an existing array item

Source

pub fn close_entry_dialog(&mut self)

Close the entry dialog without saving (pops from stack)

Source

pub fn open_nested_entry_dialog(&mut self)

Open a nested entry dialog for a Map or ObjectArray field within the current dialog

This enables recursive editing: if a dialog field is itself a Map or ObjectArray, pressing Enter will open a new dialog on top of the stack for that nested structure.

Source

pub fn save_entry_dialog(&mut self)

Save the entry dialog and apply changes

Automatically detects whether this is a Map or ObjectArray dialog and handles saving appropriately.

Source

pub fn delete_entry_dialog(&mut self)

Delete the entry from the map and close the dialog

Source

pub fn max_scroll(&self) -> u16

Get the maximum scroll offset for the current page (in rows)

Source

pub fn scroll_up(&mut self, delta: usize) -> bool

Scroll up by a given number of rows Returns true if the scroll offset changed

Source

pub fn scroll_down(&mut self, delta: usize) -> bool

Scroll down by a given number of rows Returns true if the scroll offset changed

Source

pub fn scroll_to_ratio(&mut self, ratio: f32) -> bool

Scroll to a position based on a ratio (0.0 to 1.0) Returns true if the scroll offset changed

Source

pub fn is_number_control(&self) -> bool

Start text editing mode for TextList, Text, or Map controls Check if the current control is a number input

Source

pub fn start_editing(&mut self)

Source

pub fn stop_editing(&mut self)

Stop text editing mode

Source

pub fn is_editable_control(&self) -> bool

Check if the current item is editable (TextList, Text, Map, or Json)

Source

pub fn is_editing_json(&self) -> bool

Check if currently editing a JSON control

Source

pub fn text_insert(&mut self, c: char)

Insert a character into the current editable control

Source

pub fn text_backspace(&mut self)

Backspace in the current editable control

Source

pub fn text_move_left(&mut self)

Move cursor left in the current editable control

Source

pub fn text_move_right(&mut self)

Move cursor right in the current editable control

Source

pub fn text_focus_prev(&mut self)

Move focus to previous item in TextList/Map (wraps within control)

Source

pub fn text_focus_next(&mut self)

Move focus to next item in TextList/Map (wraps within control)

Source

pub fn text_add_item(&mut self)

Add new item in TextList/Map (from the new item field)

Source

pub fn text_remove_focused(&mut self)

Remove the currently focused item in TextList/Map

Source

pub fn json_cursor_up(&mut self)

Move cursor up in JSON editor

Source

pub fn json_cursor_down(&mut self)

Move cursor down in JSON editor

Source

pub fn json_insert_newline(&mut self)

Insert newline in JSON editor

Source

pub fn json_delete(&mut self)

Delete character at cursor in JSON editor

Source

pub fn json_exit_editing(&mut self)

Stop JSON editing: commit if valid, revert if invalid

Source

pub fn json_select_all(&mut self)

Select all text in JSON editor

Source

pub fn json_selected_text(&self) -> Option<String>

Get selected text from JSON editor

Source

pub fn json_cursor_up_selecting(&mut self)

Move cursor up with selection in JSON editor

Source

pub fn json_cursor_down_selecting(&mut self)

Move cursor down with selection in JSON editor

Source

pub fn json_cursor_left_selecting(&mut self)

Move cursor left with selection in JSON editor

Source

pub fn json_cursor_right_selecting(&mut self)

Move cursor right with selection in JSON editor

Source

pub fn is_dropdown_open(&self) -> bool

Check if current item is a dropdown with menu open

Source

pub fn dropdown_toggle(&mut self)

Toggle dropdown open/closed

Source

pub fn dropdown_prev(&mut self)

Select previous option in dropdown

Source

pub fn dropdown_next(&mut self)

Select next option in dropdown

Source

pub fn dropdown_home(&mut self)

Jump to first option in dropdown

Source

pub fn dropdown_end(&mut self)

Jump to last option in dropdown

Source

pub fn dropdown_confirm(&mut self)

Confirm dropdown selection (close and record change)

Source

pub fn dropdown_cancel(&mut self)

Cancel dropdown (restore original value and close)

Source

pub fn dropdown_select(&mut self, option_idx: usize)

Select a specific dropdown option by index and confirm

Source

pub fn set_dropdown_hover(&mut self, hover_idx: Option<usize>) -> bool

Set dropdown hover index (for mouse hover indication) Returns true if the hover index changed

Source

pub fn dropdown_scroll(&mut self, delta: i32)

Scroll open dropdown by delta (positive = down, negative = up)

Source

pub fn is_number_editing(&self) -> bool

Check if current item is a number input being edited

Source

pub fn start_number_editing(&mut self)

Start number editing mode

Source

pub fn number_insert(&mut self, c: char)

Insert a character into number input

Source

pub fn number_backspace(&mut self)

Backspace in number input

Source

pub fn number_confirm(&mut self)

Confirm number editing

Source

pub fn number_cancel(&mut self)

Cancel number editing

Source

pub fn number_delete(&mut self)

Delete character forward in number input

Source

pub fn number_move_left(&mut self)

Move cursor left in number input

Source

pub fn number_move_right(&mut self)

Move cursor right in number input

Source

pub fn number_move_home(&mut self)

Move cursor to start of number input

Source

pub fn number_move_end(&mut self)

Move cursor to end of number input

Source

pub fn number_move_left_selecting(&mut self)

Move cursor left selecting in number input

Source

pub fn number_move_right_selecting(&mut self)

Move cursor right selecting in number input

Source

pub fn number_move_home_selecting(&mut self)

Move cursor to start selecting in number input

Source

pub fn number_move_end_selecting(&mut self)

Move cursor to end selecting in number input

Source

pub fn number_move_word_left(&mut self)

Move word left in number input

Source

pub fn number_move_word_right(&mut self)

Move word right in number input

Source

pub fn number_move_word_left_selecting(&mut self)

Move word left selecting in number input

Source

pub fn number_move_word_right_selecting(&mut self)

Move word right selecting in number input

Source

pub fn number_select_all(&mut self)

Select all text in number input

Source

pub fn number_delete_word_backward(&mut self)

Delete word backward in number input

Source

pub fn number_delete_word_forward(&mut self)

Delete word forward in number input

Source

pub fn get_change_descriptions(&self) -> Vec<String>

Get list of pending changes for display

Trait Implementations§

Source§

impl Debug for SettingsState

Source§

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

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

impl InputHandler for SettingsState

Source§

fn handle_key_event( &mut self, event: &KeyEvent, ctx: &mut InputContext, ) -> InputResult

Handle a key event. Returns whether the event was consumed.
Source§

fn is_modal(&self) -> bool

Whether this handler is modal (consumes all unhandled input).
Source§

fn focused_child(&self) -> Option<&dyn InputHandler>

Get the currently focused child handler, if any.
Source§

fn focused_child_mut(&mut self) -> Option<&mut dyn InputHandler>

Get the currently focused child handler mutably, if any.
Source§

fn dispatch_input( &mut self, event: &KeyEvent, ctx: &mut InputContext, ) -> InputResult

Dispatch input through this handler and its children. This is the main entry point - it handles the bubble-up logic.

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ParallelSend for T