pub struct Editor {
pub tabs: Vec<Tab>,
pub active: usize,
pub line_numbers: bool,
pub relative_line_numbers: bool,
pub show_whitespace: bool,
pub soft_wrap: bool,
pub indent: String,
pub split_root: Option<Pane>,
pub focused_leaf: usize,
}Expand description
The tab strip: a stack of open buffers and the active index.
Fields§
§tabs: Vec<Tab>Open buffers, left to right.
active: usizeIndex of the active tab.
line_numbers: boolWhether the line-number gutter is shown.
relative_line_numbers: boolWhether line numbers are shown relative to the cursor line.
show_whitespace: boolWhether visible-whitespace glyphs are shown.
soft_wrap: boolWhether long lines soft-wrap.
indent: StringString Tab inserts in every buffer (spaces or a tab).
split_root: Option<Pane>Split layout (a binary tree of panes), when the editor area is divided.
None is the normal single-pane case.
focused_leaf: usizeIn-order index of the focused leaf within split_root (0 when unsplit).
Implementations§
Source§impl Editor
impl Editor
Sourcepub fn new(
line_numbers: bool,
show_whitespace: bool,
soft_wrap: bool,
indent: String,
) -> Self
pub fn new( line_numbers: bool, show_whitespace: bool, soft_wrap: bool, indent: String, ) -> Self
Create an editor with one empty buffer and the given gutter / whitespace / soft-wrap / indentation settings.
Sourcepub fn active_tab(&self) -> Option<&Tab>
pub fn active_tab(&self) -> Option<&Tab>
The active tab, if any.
Sourcepub fn active_tab_mut(&mut self) -> Option<&mut Tab>
pub fn active_tab_mut(&mut self) -> Option<&mut Tab>
Mutable access to the active tab, if any.
Sourcepub fn set_split(&mut self, dir: SplitDir)
pub fn set_split(&mut self, dir: SplitDir)
Split the focused pane in dir, showing another tab (the next one, else
the active tab) in the new pane. Creates the split on the first call; later
calls split the currently focused pane. Capped at MAX_LEAVES panes.
Sourcepub fn unsplit(&mut self)
pub fn unsplit(&mut self)
Remove the focused pane, collapsing the split; a single remaining pane returns to the unsplit state.
Sourcepub fn focus_leaf(&mut self, i: usize)
pub fn focus_leaf(&mut self, i: usize)
Focus the leaf at in-order index i, making its tab active.
Sourcepub fn focus_other_pane(&mut self)
pub fn focus_other_pane(&mut self)
Move focus to the next pane (wrapping), making its tab active.
Sourcepub fn focused_leaf(&self) -> usize
pub fn focused_leaf(&self) -> usize
The in-order index of the focused pane.
Sourcepub fn split_layout(&mut self, area: Rect) -> Vec<LeafBox>
pub fn split_layout(&mut self, area: Rect) -> Vec<LeafBox>
Lay out the split panes into area (focused leaf synced to active).
Empty when unsplit.
Sourcepub fn split_dividers(&self, area: Rect) -> Vec<(SplitDir, Rect)>
pub fn split_dividers(&self, area: Rect) -> Vec<(SplitDir, Rect)>
The split divider rectangles for drawing, given the editor area.
Sourcepub fn focus_pane_at(&mut self, area: Rect, col: u16, row: u16) -> bool
pub fn focus_pane_at(&mut self, area: Rect, col: u16, row: u16) -> bool
Focus the pane under (col, row) within area; returns whether a pane was
hit.
Sourcepub fn resize_split_at(&mut self, area: Rect, col: u16, row: u16) -> bool
pub fn resize_split_at(&mut self, area: Rect, col: u16, row: u16) -> bool
Drag a split divider under (col, row) within area; returns whether one
was resized.
Sourcepub fn new_tab_with_content(&mut self, content: &str)
pub fn new_tab_with_content(&mut self, content: &str)
Open a new untitled tab pre-filled with content (e.g. AI output), marked
dirty so the user is reminded to save it. Becomes the active tab.
Sourcepub fn open_image(&mut self, path: &Path, proto: StatefulProtocol)
pub fn open_image(&mut self, path: &Path, proto: StatefulProtocol)
Open an image file in a tab, rendered with the given protocol.
Sourcepub fn refresh_line_numbers(&mut self)
pub fn refresh_line_numbers(&mut self)
Apply the current line-number settings (visibility + relative) to every buffer.
Sourcepub fn refresh_whitespace(&mut self)
pub fn refresh_whitespace(&mut self)
Apply the current visible-whitespace setting to every buffer.
Sourcepub fn refresh_soft_wrap(&mut self)
pub fn refresh_soft_wrap(&mut self)
Apply the current soft-wrap setting to every buffer.
Sourcepub fn refresh_theme(&mut self)
pub fn refresh_theme(&mut self)
Re-apply the current theme’s styles to every buffer (after a theme switch).
Sourcepub fn open(&mut self, path: &Path, preview: bool) -> Result<()>
pub fn open(&mut self, path: &Path, preview: bool) -> Result<()>
Open a file: focus it if already open, otherwise load it. preview
requests an ephemeral tab that the next preview reuses.
§Errors
Returns an error if the file cannot be read.
Sourcepub fn reload_clean_from_disk(&mut self) -> usize
pub fn reload_clean_from_disk(&mut self) -> usize
Reload every clean (non-dirty) file-backed buffer from disk, preserving the cursor where it still fits. Used after an external change to the working tree (e.g. a git branch switch). Dirty buffers are left untouched so unsaved edits are never discarded. Returns the number of buffers reloaded.
Sourcepub fn promote_active(&mut self)
pub fn promote_active(&mut self)
Promote the active preview tab to a permanent tab.
Sourcepub fn save_active(&mut self, opts: SaveOptions) -> Result<PathBuf>
pub fn save_active(&mut self, opts: SaveOptions) -> Result<PathBuf>
Save the active buffer to its existing path.
§Errors
Returns an error if the buffer has no path, or the write fails.
Sourcepub fn save_active_as(
&mut self,
path: PathBuf,
opts: SaveOptions,
) -> Result<PathBuf>
pub fn save_active_as( &mut self, path: PathBuf, opts: SaveOptions, ) -> Result<PathBuf>
Save the active buffer to path and adopt it as the buffer’s path.
§Errors
Returns an error if the write fails.
Sourcepub fn close_active(&mut self) -> Option<PathBuf>
pub fn close_active(&mut self) -> Option<PathBuf>
Close the active tab; keeps at least one empty buffer open. Returns the closed tab’s file path, if it had one (for “reopen closed tab”).
Sourcepub fn close_all(&mut self) -> Vec<PathBuf>
pub fn close_all(&mut self) -> Vec<PathBuf>
Close every tab, leaving a single empty untitled buffer. Returns the file paths of the closed tabs, oldest first (for “reopen closed tab”).
Sourcepub fn cursor_1based(&self) -> (usize, usize)
pub fn cursor_1based(&self) -> (usize, usize)
1-based (line, column) of the active cursor, for the status bar.
Sourcepub fn active_line_count(&self) -> usize
pub fn active_line_count(&self) -> usize
Total line count of the active buffer (for the scrollbar).
Sourcepub fn goto(&mut self, line: usize, col: Option<usize>, area: Rect)
pub fn goto(&mut self, line: usize, col: Option<usize>, area: Rect)
Jump the active buffer to a 1-based line and optional 1-based column,
keeping the target visible within area. The line is clamped to the
buffer’s range (an out-of-range line would otherwise panic).
Sourcepub fn cursor_line_home(&mut self)
pub fn cursor_line_home(&mut self)
Move the active cursor to the start of its current line. Smart Home: jump to the first non-blank character of the line; if already there (or the line is blank), jump to column 0. Pressing Home repeatedly toggles between the two.
Sourcepub fn cursor_document_start(&mut self, area: Rect)
pub fn cursor_document_start(&mut self, area: Rect)
Move the active cursor to the very start of the buffer and scroll it into
area.
Sourcepub fn cursor_document_end(&mut self, area: Rect)
pub fn cursor_document_end(&mut self, area: Rect)
Move the active cursor to the very end of the buffer (past the last
character) and scroll it into area.
Sourcepub fn cursor_line_end(&mut self)
pub fn cursor_line_end(&mut self)
Move the active cursor to the end of its current line.
Sourcepub fn cursor_line_start(&mut self)
pub fn cursor_line_start(&mut self)
Move the active cursor to column 0 of its current line (the literal line
start, unlike the smart-Home cursor_line_home).
Sourcepub fn cursor_paragraph_start(&mut self, area: Rect)
pub fn cursor_paragraph_start(&mut self, area: Rect)
Move the active cursor to the first line of the current paragraph and
scroll it into area. Paragraphs are delimited by blank (empty or
whitespace-only) lines; from a blank line, climbs to the paragraph above.
Sourcepub fn cursor_paragraph_end(&mut self, area: Rect)
pub fn cursor_paragraph_end(&mut self, area: Rect)
Move the active cursor to the end of the last line of the current
paragraph and scroll it into area. See [cursor_paragraph_start].
Sourcepub fn cursor_section_start(&mut self, area: Rect)
pub fn cursor_section_start(&mut self, area: Rect)
Move the active cursor to the first line of the current section and scroll
it into area. Sections are delimited by a run of two or more consecutive
blank lines (a larger break than a paragraph).
Sourcepub fn cursor_section_end(&mut self, area: Rect)
pub fn cursor_section_end(&mut self, area: Rect)
Move the active cursor to the end of the last line of the current section
and scroll it into area. See [cursor_section_start].
Sourcepub fn cursor_line_down(&mut self, area: Rect)
pub fn cursor_line_down(&mut self, area: Rect)
Move the active cursor down one line (Go → Line → Next).
Sourcepub fn cursor_line_up(&mut self, area: Rect)
pub fn cursor_line_up(&mut self, area: Rect)
Move the active cursor up one line (Go → Line → Previous).
Sourcepub fn cursor_line(&self) -> usize
pub fn cursor_line(&self) -> usize
0-based line of the active cursor (0 when there is no buffer).
Sourcepub fn poll_parse(&mut self) -> bool
pub fn poll_parse(&mut self) -> bool
Install any completed background reparse for the active buffer (large
files). Returns true if the syntax tree changed (request a redraw).
Sourcepub fn parse_pending(&self) -> bool
pub fn parse_pending(&self) -> bool
Whether a background reparse is in flight for the active buffer.
Sourcepub fn switch_undo_branch(&mut self) -> bool
pub fn switch_undo_branch(&mut self) -> bool
Cycle which undo-tree branch the next redo follows in the active buffer.
Returns true if the current state has more than one branch.
Sourcepub fn top_visible_line(&self) -> usize
pub fn top_visible_line(&self) -> usize
The 0-based index of the active buffer’s first visible line (vertical scroll offset), or 0 when there is no buffer.
Sourcepub fn set_word_marks(&mut self, marks: Vec<(usize, usize)>)
pub fn set_word_marks(&mut self, marks: Vec<(usize, usize)>)
Set the passive word-occurrence marks on the active buffer.
Sourcepub fn cursor_paragraph_next(&mut self, area: Rect)
pub fn cursor_paragraph_next(&mut self, area: Rect)
Move to the start of the next paragraph (Go → Paragraph → Next).
Sourcepub fn cursor_paragraph_prev(&mut self, area: Rect)
pub fn cursor_paragraph_prev(&mut self, area: Rect)
Move to the start of the previous paragraph (Go → Paragraph → Previous).
Sourcepub fn goto_paragraph(&mut self, n: usize, area: Rect)
pub fn goto_paragraph(&mut self, n: usize, area: Rect)
Jump to the 1-based nth paragraph (Go → Paragraph → Number).
Sourcepub fn cursor_section_next(&mut self, area: Rect)
pub fn cursor_section_next(&mut self, area: Rect)
Move to the start of the next section (Go → Section → Next).
Sourcepub fn cursor_section_prev(&mut self, area: Rect)
pub fn cursor_section_prev(&mut self, area: Rect)
Move to the start of the previous section (Go → Section → Previous).
Sourcepub fn goto_section(&mut self, n: usize, area: Rect)
pub fn goto_section(&mut self, n: usize, area: Rect)
Jump to the 1-based nth section (Go → Section → Number).
Sourcepub fn goto_offset(&mut self, off: usize, area: Rect)
pub fn goto_offset(&mut self, off: usize, area: Rect)
Move the active cursor to char offset off and scroll it into view.
Move the active cursor to char offset off and scroll it into view.
Sourcepub fn cursor_sentence_start(&mut self, area: Rect)
pub fn cursor_sentence_start(&mut self, area: Rect)
Move to the start of the current sentence (Go → Sentence → Start).
Sourcepub fn cursor_sentence_end(&mut self, area: Rect)
pub fn cursor_sentence_end(&mut self, area: Rect)
Move to the end of the current sentence — its last non-blank char (Go → Sentence → End).
Sourcepub fn cursor_sentence_next(&mut self, area: Rect)
pub fn cursor_sentence_next(&mut self, area: Rect)
Move to the start of the next sentence (Go → Sentence → Next).
Sourcepub fn cursor_sentence_prev(&mut self, area: Rect)
pub fn cursor_sentence_prev(&mut self, area: Rect)
Move to the start of the previous sentence (Go → Sentence → Previous).
Sourcepub fn goto_sentence(&mut self, n: usize, area: Rect)
pub fn goto_sentence(&mut self, n: usize, area: Rect)
Jump to the 1-based nth sentence (Go → Sentence → Number).
Sourcepub fn cursor_word_start(&mut self, area: Rect)
pub fn cursor_word_start(&mut self, area: Rect)
Move to the start of the current word — or the previous word’s start if the cursor is not on a word (Go → Word → Start).
Sourcepub fn cursor_word_end(&mut self, area: Rect)
pub fn cursor_word_end(&mut self, area: Rect)
Move to the end of the current word (Go → Word → End).
Sourcepub fn cursor_word_next(&mut self, area: Rect)
pub fn cursor_word_next(&mut self, area: Rect)
Move to the start of the next word (Go → Word → Next).
Sourcepub fn cursor_word_prev(&mut self, area: Rect)
pub fn cursor_word_prev(&mut self, area: Rect)
Move to the start of the previous word (Go → Word → Previous).
Sourcepub fn goto_word(&mut self, n: usize, area: Rect)
pub fn goto_word(&mut self, n: usize, area: Rect)
Jump to the 1-based nth word (Go → Word → Number).
Sourcepub fn goto_percent(&mut self, pct: usize, area: Rect)
pub fn goto_percent(&mut self, pct: usize, area: Rect)
Jump to pct% through the file (by line), clamped to 0..=100.
Sourcepub fn goto_byte(&mut self, byte: usize, area: Rect)
pub fn goto_byte(&mut self, byte: usize, area: Rect)
Jump to the character at byte offset byte (clamped to the buffer end).
Sourcepub fn select_line(&mut self, area: Rect)
pub fn select_line(&mut self, area: Rect)
Select the current line, including its trailing newline (so it can be cut
as a whole line), and scroll it into area.
Sourcepub fn select_paragraph(&mut self, area: Rect)
pub fn select_paragraph(&mut self, area: Rect)
Select the whole paragraph under the cursor (blank-line delimited) and
scroll it into area.
Sourcepub fn select_section(&mut self, area: Rect)
pub fn select_section(&mut self, area: Rect)
Select the whole section under the cursor (delimited by runs of two or
more blank lines) and scroll it into area.
Sourcepub fn insert_str(&mut self, text: &str, area: Rect) -> bool
pub fn insert_str(&mut self, text: &str, area: Rect) -> bool
Insert text at the active buffer’s cursor and scroll it into area.
Returns whether the text was inserted (false when there is no editable
buffer, e.g. an image tab). Marks the buffer dirty and promotes a preview.
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select the entire active buffer.
Sourcepub fn duplicate_line(&mut self)
pub fn duplicate_line(&mut self)
Duplicate the cursor line (or the selection) in the active buffer.
Sourcepub fn join_lines(&mut self)
pub fn join_lines(&mut self)
Join the active buffer’s current line with the next (or all selected lines into one).
Sourcepub fn sort_lines(&mut self)
pub fn sort_lines(&mut self)
Sort the active buffer’s selected lines ascending, or the whole buffer when nothing is selected.
Sourcepub fn trim_trailing_whitespace(&mut self)
pub fn trim_trailing_whitespace(&mut self)
Strip trailing whitespace from the selected lines (or the whole buffer).
Sourcepub fn remove_duplicate_lines(&mut self)
pub fn remove_duplicate_lines(&mut self)
Remove duplicate lines in the selection (or the whole buffer).
Sourcepub fn reverse_lines(&mut self)
pub fn reverse_lines(&mut self)
Reverse the order of the selected lines (or the whole buffer).
Sourcepub fn sort_unique(&mut self)
pub fn sort_unique(&mut self)
Sort the selected lines ascending and drop duplicates (or the whole buffer).
Sourcepub fn shuffle_lines(&mut self)
pub fn shuffle_lines(&mut self)
Randomly reorder the selected lines (or the whole buffer).
Sourcepub fn move_line(&mut self, down: bool, area: Rect)
pub fn move_line(&mut self, down: bool, area: Rect)
Move the active buffer’s cursor line up or down by one row, scrolling it
into area.
Sourcepub fn select_word(&mut self, forward: bool, area: Rect)
pub fn select_word(&mut self, forward: bool, area: Rect)
Extend the selection by one word: forward grows the active end to the
next word boundary on the right (“Select More”), otherwise to the previous
word boundary on the left (“Select Less”).
Sourcepub fn jump_matching_bracket(&mut self, area: Rect)
pub fn jump_matching_bracket(&mut self, area: Rect)
Jump the cursor to the partner of the bracket at (or just before) it,
scrolling it into area. No-op when the cursor is not on a bracket.
Sourcepub fn delete_forward(&mut self)
pub fn delete_forward(&mut self)
Forward-delete (the Delete key): step right, then delete back.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Editor
impl !Send for Editor
impl !Sync for Editor
impl !UnwindSafe for Editor
impl Freeze for Editor
impl Unpin for Editor
impl UnsafeUnpin for Editor
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
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 moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more