pub struct DrawingManager {
pub registry: DrawingToolRegistry,
pub tool_defaults: HashMap<DrawingToolType, DrawingTemplate>,
pub drawings: Vec<Drawing>,
pub options: DrawingManagerOptions,
pub stay_in_drawing_mode: bool,
pub curr_timeframe: String,
pub pending_sync: Arc<Mutex<Vec<DrawingSyncAction>>>,
/* private fields */
}Expand description
Central coordinator for chart drawings.
DrawingManager owns the list of completed drawings and the in-progress
drawing, and delegates business logic to specialized services:
- Selection via
SelectionService - Undo/redo via
HistoryService - Snapping via
SnapService - Handle manipulation via
HandleService
§Frame loop integration
// 1. Sync state from app
manager.sync_from_app_state(drawing_state);
// 2. Update screen coordinates from chart coordinates
manager.update_all_screen_coords(bar_to_x, price_to_y);
// 3. Handle user input (clicks, drags, keyboard)
// ... (start_drawing_with_coords, add_point_with_coords, etc.)
// 4. Render against the chart's bars and coordinate mapping
let view = ChartView { price_formatter: None, time_formatter: None, bar_seconds: 0, instrument: None, bars, revision, bar_to_x: &bar_to_x, price_to_y: &price_to_y, y_to_price: &y_to_price, time_axis: true, executions: None, timeframe: None, finer: &[] };
manager.render_all(painter, price_rect, &view);Fields§
§registry: DrawingToolRegistryHost tools and built-in availability. Register tools before restoring their drawings.
tool_defaults: HashMap<DrawingToolType, DrawingTemplate>Per-tool defaults, exportable with serde for host-owned application storage. New drawings use these properties without copying geometry, identity or layer.
drawings: Vec<Drawing>All completed drawings on the chart.
options: DrawingManagerOptionsManager configuration (colors, snapping, handles).
stay_in_drawing_mode: boolWhether to stay in drawing mode after completing a drawing. A finished measurement always returns to selection mode.
curr_timeframe: StringCurrent chart timeframe string (e.g., "1D", "1h"): drawings hidden on it are
neither drawn nor hit. Chart::set_timeframe
keeps it in step with the chart.
pending_sync: Arc<Mutex<Vec<DrawingSyncAction>>>Changes to the stored drawings, oldest first, for the host to drain, for example
with std::mem::take(&mut *manager.pending_sync.lock().unwrap()). See
DrawingSyncAction.
Implementations§
Source§impl DrawingManager
impl DrawingManager
Sourcepub fn delete_drawing(&mut self, id: usize)
pub fn delete_drawing(&mut self, id: usize)
Deletes the drawing with the given ID from the drawing list.
The deleted drawing is pushed to the undo history and a cloud sync delete action is queued. If the deleted drawing was selected, the selection is cleared. A locked drawing is not deleted.
Sourcepub fn delete_selected(&mut self)
pub fn delete_selected(&mut self)
Deletes the selected drawings, keeping any locked ones.
Sourcepub fn clear_all(&mut self)
pub fn clear_all(&mut self)
Removes every drawing that is not locked and clears the current drawing and selection.
Queues a Delete for each drawing it removes, so the host deletes their stored records.
To unload drawings without deleting them, clear Self::drawings, then call
Self::cancel_curr_drawing and Self::deselect. A bulk removal is one undo step.
Sourcepub fn bring_to_front(&mut self, id: usize)
pub fn bring_to_front(&mut self, id: usize)
Bring a drawing to the front (drawn last, on top), above the highest z-order
Sourcepub fn send_to_back(&mut self, id: usize)
pub fn send_to_back(&mut self, id: usize)
Send a drawing to the back (drawn first, behind others), below the lowest z-order
Sourcepub fn reorder_drawings(&mut self, id: usize, layers: &[(usize, i32)])
pub fn reorder_drawings(&mut self, id: usize, layers: &[(usize, i32)])
Apply a layer move as one undo step, saving each changed drawing.
Sourcepub fn duplicate_drawing(&mut self, id: usize)
pub fn duplicate_drawing(&mut self, id: usize)
Duplicate a drawing three bars to the right, recording its creation for undo and saving. Adds nothing for a drawing of a disabled tool or a copy that saving would refuse.
Sourcepub fn paste_drawings(&mut self, drawings: &[Drawing])
pub fn paste_drawings(&mut self, drawings: &[Drawing])
Paste copies three bars to the right with fresh identities, selecting them as one undoable addition. The caller maps clipboard anchors into this manager’s chart coordinates first. Leaves out a copy of a disabled tool or an unregistered custom tool and a copy that saving would refuse; when it leaves out every copy, it selects nothing and records no undo step.
Sourcepub fn edit_drawing(&mut self, id: usize, edit: impl FnOnce(&mut Drawing))
pub fn edit_drawing(&mut self, id: usize, edit: impl FnOnce(&mut Drawing))
Applies edit to the drawing with the given ID, records it for undo and queues it to
be saved. Edit a drawing through this rather than Self::drawings so the change is
saved. A locked drawing accepts only visibility, name and folder changes, or an edit that unlocks it.
Does nothing if there is no such drawing.
Sourcepub fn edit_drawings(&mut self, ids: &[usize], edit: impl FnMut(&mut Drawing))
pub fn edit_drawings(&mut self, ids: &[usize], edit: impl FnMut(&mut Drawing))
Edits live drawing ids as one undo step and queues their saved changes. Locked drawings accept visibility, name and folder changes, or an edit that unlocks them.
Sourcepub fn drag_edit_drawing(&mut self, id: usize, edit: impl FnOnce(&mut Drawing))
pub fn drag_edit_drawing(&mut self, id: usize, edit: impl FnOnce(&mut Drawing))
Applies edit as one frame of a continuous edit, such as dragging a colour picker: the
first frame records the drawing’s state and nothing is queued until
Self::end_drag_handle, which makes the whole gesture one undo step and queues one
update. Does nothing if there is no such drawing or it is locked.
Sourcepub fn update_all_screen_coords<F, G>(&mut self, bar_to_x: F, price_to_y: G)
pub fn update_all_screen_coords<F, G>(&mut self, bar_to_x: F, price_to_y: G)
Recomputes screen coordinates for all drawings (completed and in-progress) from their persistent chart coordinates using the current pan/zoom transforms.
Must be called each frame before rendering.
Sourcepub fn update_pane_anchors(&mut self, pane: Rect)
pub fn update_pane_anchors(&mut self, pane: Rect)
Projects anchored annotations into pane after chart-coordinate updates.
The chart calls this automatically; standalone managers call it before rendering.
Sourcepub fn shift_bar_indices(&mut self, from: f32, shift: f32)
pub fn shift_bar_indices(&mut self, from: f32, shift: f32)
Shifts every bar index at or after from by shift, across all
drawings, the in-progress drawing, the state a handle drag restores on
undo, and the undo history.
This is called when bars are inserted in front of existing ones, causing
the bar indices from there on to shift right. Pass f32::NEG_INFINITY
for bars inserted in front of the first bar.
Sourcepub fn toggle_visibility_all(&mut self)
pub fn toggle_visibility_all(&mut self)
Toggles the visibility of all drawings. If all are visible, hides them all; otherwise shows them all.
Sourcepub fn set_visibility_all(&mut self, visible: bool)
pub fn set_visibility_all(&mut self, visible: bool)
Set every drawing’s visibility as one undoable edit.
Sourcepub fn toggle_lock_all(&mut self)
pub fn toggle_lock_all(&mut self)
Toggles the lock state of all drawings. If all are locked, unlocks them all; otherwise locks them all.
Sourcepub fn add_drawing(&mut self, drawing: Drawing) -> Result<usize, &'static str>
pub fn add_drawing(&mut self, drawing: Drawing) -> Result<usize, &'static str>
Adds a completed drawing with validated chart coordinates and properties as one undo
step. Assigns a fresh id, retains the supplied layer, and queues a save if saveable.
Use Chart::create_drawing when the anchors are UTC times rather than bar indices.
Sourcepub fn listed_drawings(&self) -> impl Iterator<Item = &Drawing>
pub fn listed_drawings(&self) -> impl Iterator<Item = &Drawing>
Drawings included in host object lists, in drawing-list order.
Sourcepub fn group_drawings<'a>(
&'a self,
group: &'a str,
) -> impl Iterator<Item = &'a Drawing>
pub fn group_drawings<'a>( &'a self, group: &'a str, ) -> impl Iterator<Item = &'a Drawing>
Members of a host-defined group, including hidden and locked drawings.
Sourcepub fn set_group(&mut self, ids: &[usize], group: Option<String>)
pub fn set_group(&mut self, ids: &[usize], group: Option<String>)
Assigns or removes group membership for live ids as one undo step. Locked drawings keep their membership. Group names are host-owned and are saved with each member.
Sourcepub fn select_group(&mut self, group: &str)
pub fn select_group(&mut self, group: &str)
Selects all selectable members of a group for the existing move, edit and delete operations. Those operations retain their lock checks and single undo step.
Sourcepub fn add_synced_drawing(
&mut self,
drawing: Drawing,
) -> Result<usize, &'static str>
pub fn add_synced_drawing( &mut self, drawing: Drawing, ) -> Result<usize, &'static str>
Add a drawing from another source (for multi-chart sync, or restored from storage)
under a new id, and return the id. A drawing restored from storage keeps its stored
identity (stored_id, created_at, notes) and its z-order. A drawing that was never
stored goes on top, and so does a copy, one stored under the id of a drawing already
here, which is saved as a new drawing.
Refuses, and adds nothing, a drawing that saving would refuse: a cursor tool, fewer anchors than the tool draws with, a non-finite coordinate, an anchor too far out to map to a time or a setting out of range. Tool availability does not apply: drawings of a disabled tool are restored and synced.
Source§impl DrawingManager
impl DrawingManager
Sourcepub fn get_handles(&self, drawing: &Drawing) -> Vec<(HandlePos, Pos2)>
pub fn get_handles(&self, drawing: &Drawing) -> Vec<(HandlePos, Pos2)>
Returns the selection handle positions for a drawing (tool-type-aware).
Regression trends use the fitted endpoints from the last Self::render_all.
Sourcepub fn hit_test_handle(
&self,
drawing: &Drawing,
point: Pos2,
) -> Option<HandlePos>
pub fn hit_test_handle( &self, drawing: &Drawing, point: Pos2, ) -> Option<HandlePos>
Hit-tests a point against the handles of a drawing.
Returns the HandlePos if a handle was hit, None otherwise.
Sourcepub fn start_drag_handle(&mut self, drawing_id: usize, handle: HandlePos)
pub fn start_drag_handle(&mut self, drawing_id: usize, handle: HandlePos)
Begins a handle drag operation, saving the drawing’s current state for undo. A locked drawing is not dragged.
Sourcepub fn start_drag_body(&mut self, drawing_id: usize, origin: Pos2)
pub fn start_drag_body(&mut self, drawing_id: usize, origin: Pos2)
Begins moving the anchors that move with the body (all but a bars pattern’s source)
from a grab at origin, retaining the grab offset.
Locked drawings ignore the grab. The move shares the handle drag’s undo and sync lifecycle.
Sourcepub fn update_drag_handle<F, G, H>(
&mut self,
new_pos: Pos2,
x_to_bar: F,
y_to_price: G,
translate_price: H,
)
pub fn update_drag_handle<F, G, H>( &mut self, new_pos: Pos2, x_to_bar: F, y_to_price: G, translate_price: H, )
Updates the position of the currently dragged handle to new_pos,
applying snap behavior and coordinate conversion.
translate_price(price, from_y, to_y) shifts whole-drawing prices in scale units;
y_to_price retains the pointer bounds for individual handles.
Sourcepub fn end_drag_handle(&mut self)
pub fn end_drag_handle(&mut self)
Ends the current handle drag or Self::drag_edit_drawing gesture, pushing one modify
command to the undo history and queuing one update for the whole gesture.
A copy drag records the additions instead, so undo removes every copy.
Sourcepub fn set_active_tool(&mut self, tool: Option<DrawingToolType>) -> bool
pub fn set_active_tool(&mut self, tool: Option<DrawingToolType>) -> bool
Sets the active drawing tool and returns whether it is now active. Pass None to exit
drawing mode and return to selection/pointer mode. A tool cancels any in-progress
drawing and leaves eraser mode. A built-in tool the registry
disables is not set: the manager returns to selection mode, as with None, and the
call returns false.
Sourcepub fn active_custom_tool(&self) -> Option<&str>
pub fn active_custom_tool(&self) -> Option<&str>
The registered tool selected for the next placement, or None for a built-in tool.
Sourcepub fn active_tool(&self) -> Option<DrawingToolType>
pub fn active_tool(&self) -> Option<DrawingToolType>
The built-in tool the next pointer placement uses, or None in selection mode. A
registered tool is active as DrawingToolType::Polyline with its id in
Self::active_custom_tool. Set it with Self::set_active_tool or
Self::set_custom_tool.
Sourcepub fn is_eraser_mode(&self) -> bool
pub fn is_eraser_mode(&self) -> bool
Whether a click deletes the drawing under the pointer instead of selecting it. Switch
it with Self::set_eraser_mode.
Sourcepub fn curr_drawing(&self) -> Option<&Drawing>
pub fn curr_drawing(&self) -> Option<&Drawing>
The drawing being placed. It joins Self::drawings when completed, except for the
temporary DrawingToolType::Measure ruler.
Sourcepub fn curr_drawing_mut(&mut self) -> Option<&mut Drawing>
pub fn curr_drawing_mut(&mut self) -> Option<&mut Drawing>
The drawing being placed, to adjust its settings before it is completed, such as the
glyph size of an icon that Self::start_icon_insertion prepared.
Sourcepub fn dragging_handle(&self) -> Option<(usize, HandlePos)>
pub fn dragging_handle(&self) -> Option<(usize, HandlePos)>
The drawing and handle being dragged, as (drawing_id, handle), from
Self::start_drag_handle or Self::start_drag_body until Self::end_drag_handle.
Sourcepub fn set_custom_tool(&mut self, id: &str) -> Result<(), &'static str>
pub fn set_custom_tool(&mut self, id: &str) -> Result<(), &'static str>
Starts a registered tool’s multi-click construction. One-anchor tools complete on the
first click. The host picker uses registry.custom_tools() for its ids and names.
Sourcepub fn show_custom_settings(&mut self, ui: &mut Ui, id: usize) -> bool
pub fn show_custom_settings(&mut self, ui: &mut Ui, id: usize) -> bool
Shows a registered tool’s settings and records a changed draft as one undoable edit. Unknown tools and locked drawings show no editor and return false.
Sourcepub fn set_eraser_mode(&mut self, on: bool)
pub fn set_eraser_mode(&mut self, on: bool)
Switches eraser mode on or off. In eraser mode a click on the chart deletes the
drawing under the pointer, unless it is locked. Switching it on leaves the active tool
and cancels any in-progress drawing; choosing a tool with Self::set_active_tool
switches it off.
Sourcepub fn start_text_annotation(&mut self)
pub fn start_text_annotation(&mut self)
Start text annotation mode
Activates the Note drawing tool, allowing the user to click the bar and price to annotate, then where the label goes.
Sourcepub fn start_icon_insertion(&mut self, icon_name: String)
pub fn start_icon_insertion(&mut self, icon_name: String)
Start icon/emoji insertion mode
Prepares a bundled icon, Unicode emoji or sticker: glyph,
allowing the user to click on the chart to place it.
Sourcepub fn start_post_insertion(&mut self, tool: DrawingToolType, post: PostLink)
pub fn start_post_insertion(&mut self, tool: DrawingToolType, post: PostLink)
Prepares a post or idea card showing post, placed by the next click on the chart, as
Self::start_icon_insertion does for a picked icon. The tool’s saved defaults apply,
and the inline editor does not open, since the card has its content. Does nothing for
other tools or a disabled one.
Sourcepub fn start_drawing_with_coords<F, G>(
&mut self,
tool_type: DrawingToolType,
point: Pos2,
x_to_bar: F,
y_to_price: G,
)
pub fn start_drawing_with_coords<F, G>( &mut self, tool_type: DrawingToolType, point: Pos2, x_to_bar: F, y_to_price: G, )
Starts a new drawing of the given tool type at the given screen position, or places the
drawing Self::start_icon_insertion prepared for it. Does nothing for a cursor tool
or a disabled built-in tool. A completed drawing that saving would refuse, such as one
whose anchor maps to a non-finite position, is dropped.
The coordinate conversion closures (x_to_bar, y_to_price) convert
screen coordinates to chart coordinates for persistent storage. If the
tool requires only one point, the drawing is immediately completed and
added to the drawing list.
Sourcepub fn add_point_with_coords<F, G>(
&mut self,
point: Pos2,
x_to_bar: F,
y_to_price: G,
)
pub fn add_point_with_coords<F, G>( &mut self, point: Pos2, x_to_bar: F, y_to_price: G, )
Adds a subsequent point to the in-progress drawing.
If the added point completes the drawing (based on
DrawingToolType::required_points), the drawing is finalized, pushed
to the drawing list, and a cloud sync action is queued.
Sourcepub fn update_last_point_with_coords<F, G>(
&mut self,
point: Pos2,
x_to_bar: F,
y_to_price: G,
)
pub fn update_last_point_with_coords<F, G>( &mut self, point: Pos2, x_to_bar: F, y_to_price: G, )
Moves the pointer preview of the in-progress drawing to point, adding it after the
placed anchors if there is none yet. The next click or the end of a drag replaces it
with an anchor; finishing a multi-point drawing drops it.
Sourcepub fn complete_curr_drawing(&mut self)
pub fn complete_curr_drawing(&mut self)
Manually completes the in-progress drawing (e.g., on double-click or Enter for multi-point tools), without its pointer preview. Requires at least 2 points, and as many as the tool draws with, so that what it adds can be saved. A drawing that saving would still refuse is dropped, and the tool stays active.
Sourcepub fn cancel_curr_drawing(&mut self)
pub fn cancel_curr_drawing(&mut self)
Cancels the in-progress drawing without adding it to the drawing list, and clears a finished measurement.
Sourcepub fn complete_drag_drawing(&mut self)
pub fn complete_drag_drawing(&mut self)
Complete a drag-to-draw drawing (see Self::complete_curr_drawing)
Sourcepub fn update_drag_handle_with_coords<F, G, H>(
&mut self,
new_pos: Pos2,
x_to_bar: F,
y_to_price: G,
translate_price: H,
)
pub fn update_drag_handle_with_coords<F, G, H>( &mut self, new_pos: Pos2, x_to_bar: F, y_to_price: G, translate_price: H, )
Alias for Self::update_drag_handle, with the same pointer mapping and price translation.
Sourcepub fn hit_test_handle_by_id(
&self,
point: Pos2,
drawing_id: usize,
) -> Option<HandlePos>
pub fn hit_test_handle_by_id( &self, point: Pos2, drawing_id: usize, ) -> Option<HandlePos>
Hit test a handle by drawing ID Returns the handle position if hit, None otherwise
Source§impl DrawingManager
impl DrawingManager
Sourcepub fn render_handles(&self, painter: &Painter, drawing: &Drawing)
pub fn render_handles(&self, painter: &Painter, drawing: &Drawing)
Renders selection handles for a drawing, highlighting the currently dragged handle (if any).
Sourcepub fn hit_test(&self, point: Pos2) -> Option<usize>
pub fn hit_test(&self, point: Pos2) -> Option<usize>
Hit-tests a screen point against all visible drawings (back-to-front).
Returns the ID of the topmost drawing at point, or None if no
drawing was hit. Delegates to DrawingInteraction::hit_test, the single
source of truth for per-segment / per-level geometry hit testing, so that
channels, Fibonacci levels, fans, and pitchforks are selectable along
their drawn geometry rather than only near a control point. Honors the
active timeframe so drawings hidden on the current timeframe are not hit.
After Self::render_all, uses the actual clipped paint geometry, including text and
data-driven bodies. Before the first paint, falls back to the tool’s geometric outline.
Sourcepub fn render_all(
&self,
painter: &Painter,
price_rect: Rect,
view: &ChartView<'_>,
)
pub fn render_all( &self, painter: &Painter, price_rect: Rect, view: &ChartView<'_>, )
Render all drawings against the chart’s bars and coordinate mapping
Source§impl DrawingManager
impl DrawingManager
Sourcepub fn set_sync_enabled(&mut self, enabled: bool)
pub fn set_sync_enabled(&mut self, enabled: bool)
Enables or disables per-drawing storage notifications. Disabling clears pending actions. Automatic chart storage disables them; enable them again to also consume notifications. Changes made while disabled are not reported.
Sourcepub fn sync_from_app_state(&mut self, drawing_state: &DrawingState)
pub fn sync_from_app_state(&mut self, drawing_state: &DrawingState)
Apply the host’s tool, snapping, color, eraser and selection state. A state with both
a tool and the eraser leaves only the eraser on, as Self::set_eraser_mode does.
Sourcepub fn sel_drawing(&self) -> Option<usize>
pub fn sel_drawing(&self) -> Option<usize>
Returns the ID of the currently selected (primary) drawing, if any.
Sourcepub fn select(&mut self, id: usize)
pub fn select(&mut self, id: usize)
Selects the drawing with the given ID (deselects all others).
Sourcepub fn select_drawings(&mut self, ids: impl IntoIterator<Item = usize>)
pub fn select_drawings(&mut self, ids: impl IntoIterator<Item = usize>)
Replace the selected drawings with the supplied live ids.
Sourcepub fn selected_ids(&self) -> impl Iterator<Item = usize> + '_
pub fn selected_ids(&self) -> impl Iterator<Item = usize> + '_
Selected live drawing ids, in drawing-list order.
Sourcepub fn is_selected(&self, id: usize) -> bool
pub fn is_selected(&self, id: usize) -> bool
Whether a drawing belongs to the current selection.
Sourcepub fn toggle_selection(&mut self, id: usize)
pub fn toggle_selection(&mut self, id: usize)
Toggle a live drawing in the selection, retaining the other selected drawings.
Sourcepub fn edit_selected(&mut self, edit: impl FnMut(&mut Drawing))
pub fn edit_selected(&mut self, edit: impl FnMut(&mut Drawing))
Apply a style edit to every unlocked selected drawing as one undo step.
Sourcepub fn select_at(&mut self, point: Pos2) -> bool
pub fn select_at(&mut self, point: Pos2) -> bool
Hit-tests at point and selects the topmost drawing found.
Returns true if a drawing was selected, false if the click hit empty space
(which deselects all drawings).
Sourcepub fn undo(&mut self) -> bool
pub fn undo(&mut self) -> bool
Undoes the last drawing operation. Returns true if an operation was undone.
Sourcepub fn redo(&mut self) -> bool
pub fn redo(&mut self) -> bool
Redoes the last undone operation. Returns true if an operation was redone.
Sourcepub fn update_snap_options(&mut self)
pub fn update_snap_options(&mut self)
Rebuilds the internal SnapService from the current manager options.
Call this after changing snap-related options.
Sourcepub fn snap_point(&self, point: Pos2, drawings: &[Drawing]) -> Pos2
pub fn snap_point(&self, point: Pos2, drawings: &[Drawing]) -> Pos2
Applies snap behavior to a screen point, returning the snapped position.
With magnet mode on, snaps to nearby chart values and visible anchors of drawings.
Targets keep their time and price paired. A dragged drawing cannot snap to itself.
Drawing anchors are borrowed without flattening or cloning their geometry.
Sourcepub fn new_drawing(&self, id: usize, tool: DrawingToolType) -> Drawing
pub fn new_drawing(&self, id: usize, tool: DrawingToolType) -> Drawing
A new drawing of tool in its default style: the tool’s own, recoloured by
DrawingManagerOptions::default_color when set, then the default saved for the tool.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DrawingManager
impl !RefUnwindSafe for DrawingManager
impl !UnwindSafe for DrawingManager
impl Send for DrawingManager
impl Sync for DrawingManager
impl Unpin for DrawingManager
impl UnsafeUnpin for DrawingManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more