pub struct WidgetInfo { /* private fields */ }
Expand description
Reference to a widget info in a WidgetInfoTree
.
Implementations§
source§impl WidgetInfo
impl WidgetInfo
sourcepub fn access(&self) -> Option<WidgetAccessInfo>
pub fn access(&self) -> Option<WidgetAccessInfo>
Accessibility info, if the widget is accessible.
The widget is accessible only if access_enabled
and some accessibility metadata was set on the widget.
sourcepub fn access_children(&self) -> impl Iterator<Item = WidgetAccessInfo>
pub fn access_children(&self) -> impl Iterator<Item = WidgetAccessInfo>
Descendant branches that have accessibility info.
The iterator enters descendants only until it finds a node that has access info, these nodes are yielded.
sourcepub fn access_parent(&self) -> Option<WidgetAccessInfo>
pub fn access_parent(&self) -> Option<WidgetAccessInfo>
First ancestor that is accessible.
source§impl WidgetInfo
impl WidgetInfo
sourcepub fn path(&self) -> WidgetPath
pub fn path(&self) -> WidgetPath
Full path to this widget.
sourcepub fn trace_path(&self) -> Txt
pub fn trace_path(&self) -> Txt
Path details to help finding the widget during debug.
If the inspector metadata is present the widget type is included.
sourcepub fn trace_id(&self) -> Txt
pub fn trace_id(&self) -> Txt
Detailed id text.
If the inspector metadata is present the widget type is included.
sourcepub fn interaction_path(&self) -> InteractionPath
pub fn interaction_path(&self) -> InteractionPath
Full path to this widget with interactivity
values.
sourcepub fn new_path(&self, old_path: &WidgetPath) -> Option<WidgetPath>
pub fn new_path(&self, old_path: &WidgetPath) -> Option<WidgetPath>
sourcepub fn new_interaction_path(
&self,
old_path: &InteractionPath,
) -> Option<InteractionPath>
pub fn new_interaction_path( &self, old_path: &InteractionPath, ) -> Option<InteractionPath>
Gets the interaction_path
if it is different from old_path
.
Only allocates a new path if needed.
§Panics
If old_path
does not point to the same widget id as self
.
sourcepub fn z_index(&self) -> Option<(ZIndex, ZIndex)>
pub fn z_index(&self) -> Option<(ZIndex, ZIndex)>
Get the z-index of the widget in the latest frame if it was rendered.
Note that widgets can render in the back and front of each descendant, these indexes are the back-most index, the moment the widget starts rendering and the front-most index at the moment the widget and all contents finishes rendering.
This value is updated every render
without causing a tree rebuild.
sourcepub fn visibility(&self) -> Visibility
pub fn visibility(&self) -> Visibility
sourcepub fn interactivity(&self) -> Interactivity
pub fn interactivity(&self) -> Interactivity
Get or compute the interactivity of the widget.
The interactivity of a widget is the combined result of all interactivity filters applied to it and its ancestors. If a parent is blocked this is blocked, same for disabled.
sourcepub fn bounds_info(&self) -> WidgetBoundsInfo
pub fn bounds_info(&self) -> WidgetBoundsInfo
All the transforms introduced by this widget, starting from the outer info.
This information is up-to-date, it is updated every layout and render without causing a tree rebuild.
sourcepub fn border_info(&self) -> WidgetBorderInfo
pub fn border_info(&self) -> WidgetBorderInfo
Clone a reference to the widget border and corner radius information.
This information is up-to-date, it is updated every layout without causing a tree rebuild.
sourcepub fn perspective(&self) -> Option<(f32, PxPoint)>
pub fn perspective(&self) -> Option<(f32, PxPoint)>
Gets the 3D perspective for this widget.
The f32
is a distance from the Z-plane to the viewer, the point is the vanishing center in the parent widget inner bounds.
sourcepub fn transform_style(&self) -> TransformStyle
pub fn transform_style(&self) -> TransformStyle
Gets the transform style for this widget.
Is Flat
unless it or the parent widget sets Preserve3D
.
sourcepub fn outer_size(&self) -> PxSize
pub fn outer_size(&self) -> PxSize
Size of the widget outer area, not transformed.
Returns an up-to-date size, the size is updated every layout without causing a tree rebuild.
sourcepub fn inner_size(&self) -> PxSize
pub fn inner_size(&self) -> PxSize
Size of the widget inner area, not transformed.
Returns an up-to-date size, the size is updated every layout without causing a tree rebuild.
sourcepub fn inner_border_size(&self) -> PxSize
pub fn inner_border_size(&self) -> PxSize
Size of the widget child area, not transformed.
Returns an up-to-date size, the size is updated every layout without causing a tree rebuild.
sourcepub fn outer_transform(&self) -> PxTransform
pub fn outer_transform(&self) -> PxTransform
Widget outer transform in window space.
Returns an up-to-date transform, the transform is updated every render or render update without causing a tree rebuild.
sourcepub fn inner_transform(&self) -> PxTransform
pub fn inner_transform(&self) -> PxTransform
Widget inner transform in the window space.
Returns an up-to-date transform, the transform is updated every render or render update without causing a tree rebuild.
sourcepub fn outer_bounds(&self) -> PxRect
pub fn outer_bounds(&self) -> PxRect
Widget outer rectangle in the window space.
Returns an up-to-date rect, the bounds are updated every render or render update without causing a tree rebuild.
sourcepub fn inner_bounds(&self) -> PxRect
pub fn inner_bounds(&self) -> PxRect
Widget inner rectangle in the window space.
Returns an up-to-date rect, the bounds are updated every render or render update without causing a tree rebuild.
sourcepub fn spatial_bounds(&self) -> PxBox
pub fn spatial_bounds(&self) -> PxBox
Compute the bounding box that envelops self and descendants inner bounds.
sourcepub fn meta(&self) -> StateMapRef<'_, WidgetInfoMeta>
pub fn meta(&self) -> StateMapRef<'_, WidgetInfoMeta>
Custom metadata associated with the widget during info build.
sourcepub fn tree(&self) -> &WidgetInfoTree
pub fn tree(&self) -> &WidgetInfoTree
Reference the WidgetInfoTree
that owns self
.
sourcepub fn is_reused(&self) -> bool
pub fn is_reused(&self) -> bool
If the widget info and all descendants did not change in the last rebuild.
sourcepub fn parent(&self) -> Option<Self>
pub fn parent(&self) -> Option<Self>
Reference to the widget that contains this widget.
Is None
only for root
.
sourcepub fn prev_sibling(&self) -> Option<Self>
pub fn prev_sibling(&self) -> Option<Self>
Reference to the previous widget within the same parent.
sourcepub fn next_sibling(&self) -> Option<Self>
pub fn next_sibling(&self) -> Option<Self>
Reference to the next widget within the same parent.
sourcepub fn first_child(&self) -> Option<Self>
pub fn first_child(&self) -> Option<Self>
Reference to the first widget within this widget.
sourcepub fn last_child(&self) -> Option<Self>
pub fn last_child(&self) -> Option<Self>
Reference to the last widget within this widget.
sourcepub fn has_siblings(&self) -> bool
pub fn has_siblings(&self) -> bool
If the parent widget has multiple children.
sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
If the widget has at least one child.
sourcepub fn siblings(&self) -> impl Iterator<Item = WidgetInfo>
pub fn siblings(&self) -> impl Iterator<Item = WidgetInfo>
All parent children except this widget.
sourcepub fn children_count(&self) -> usize
pub fn children_count(&self) -> usize
Count of children
.
sourcepub fn self_and_children(&self) -> Children ⓘ
pub fn self_and_children(&self) -> Children ⓘ
Iterator over the widget and the direct descendants of the widget.
sourcepub fn descendants(&self) -> TreeIter ⓘ
pub fn descendants(&self) -> TreeIter ⓘ
Iterator over all widgets contained by this widget.
sourcepub fn descendants_len(&self) -> usize
pub fn descendants_len(&self) -> usize
Total number of descendants
.
sourcepub fn self_and_descendants(&self) -> TreeIter ⓘ
pub fn self_and_descendants(&self) -> TreeIter ⓘ
Iterator over the widget and all widgets contained by it.
sourcepub fn descendants_range(&self) -> WidgetDescendantsRange
pub fn descendants_range(&self) -> WidgetDescendantsRange
Gets a value that can check if widgets are descendant of self
in O(1) time.
sourcepub fn is_ancestor(&self, maybe_descendant: &WidgetInfo) -> bool
pub fn is_ancestor(&self, maybe_descendant: &WidgetInfo) -> bool
If self
is an ancestor of maybe_descendant
.
sourcepub fn is_descendant(&self, maybe_ancestor: &WidgetInfo) -> bool
pub fn is_descendant(&self, maybe_ancestor: &WidgetInfo) -> bool
If self
is inside maybe_ancestor
.
sourcepub fn self_and_ancestors(&self) -> Ancestors ⓘ
pub fn self_and_ancestors(&self) -> Ancestors ⓘ
Iterator over self -> parent -> grandparent -> .. -> root.
sourcepub fn prev_siblings(&self) -> PrevSiblings ⓘ
pub fn prev_siblings(&self) -> PrevSiblings ⓘ
Iterator over all previous widgets within the same parent.
sourcepub fn self_and_prev_siblings(&self) -> PrevSiblings ⓘ
pub fn self_and_prev_siblings(&self) -> PrevSiblings ⓘ
Iterator over self and all previous widgets within the same parent.
sourcepub fn next_siblings(&self) -> NextSiblings ⓘ
pub fn next_siblings(&self) -> NextSiblings ⓘ
Iterator over all next widgets within the same parent.
sourcepub fn self_and_next_siblings(&self) -> NextSiblings ⓘ
pub fn self_and_next_siblings(&self) -> NextSiblings ⓘ
Iterator over self and all next widgets within the same parent.
sourcepub fn prev_siblings_in(&self, ancestor: &WidgetInfo) -> RevTreeIter ⓘ
pub fn prev_siblings_in(&self, ancestor: &WidgetInfo) -> RevTreeIter ⓘ
Iterator over all previous widgets within the same ancestor
, including descendants of siblings.
If ancestor
is not actually an ancestor iterates to the root.
sourcepub fn self_and_prev_siblings_in(&self, ancestor: &WidgetInfo) -> RevTreeIter ⓘ
pub fn self_and_prev_siblings_in(&self, ancestor: &WidgetInfo) -> RevTreeIter ⓘ
Iterator over self, descendants and all previous widgets within the same ancestor
.
If ancestor
is not actually an ancestor iterates to the root.
sourcepub fn next_siblings_in(&self, ancestor: &WidgetInfo) -> TreeIter ⓘ
pub fn next_siblings_in(&self, ancestor: &WidgetInfo) -> TreeIter ⓘ
Iterator over all next widgets within the same ancestor
, including descendants of siblings.
If ancestor
is not actually an ancestor iterates to the root.
sourcepub fn self_and_next_siblings_in(&self, ancestor: &WidgetInfo) -> TreeIter ⓘ
pub fn self_and_next_siblings_in(&self, ancestor: &WidgetInfo) -> TreeIter ⓘ
Iterator over self, descendants and all next widgets within the same ancestor
.
If ancestor
is not actually an ancestor iterates to the root.
sourcepub fn orientation_from(&self, origin: PxPoint) -> Option<Orientation2D>
pub fn orientation_from(&self, origin: PxPoint) -> Option<Orientation2D>
The center
orientation in relation to an origin
.
Returns None
if the origin
is the center.
sourcepub fn distance_key(&self, origin: PxPoint) -> DistanceKey
pub fn distance_key(&self, origin: PxPoint) -> DistanceKey
Value that indicates the distance between this widget center and origin
.
First ancestor of self
and other
.
Returns None
if other
is not from the same tree.
sourcepub fn is_in_bounds(&self) -> bool
pub fn is_in_bounds(&self) -> bool
Returns true
if this widget’s inner bounds are fully contained by the parent inner bounds.
sourcepub fn out_of_bounds(&self) -> impl Iterator<Item = WidgetInfo>
pub fn out_of_bounds(&self) -> impl Iterator<Item = WidgetInfo>
Iterator over all descendants with inner bounds not fully contained by their parent inner bounds.
sourcepub fn spatial_iter(
&self,
filter: impl Fn(&WidgetInfo) -> bool + Clone,
) -> impl Iterator<Item = WidgetInfo>
pub fn spatial_iter( &self, filter: impl Fn(&WidgetInfo) -> bool + Clone, ) -> impl Iterator<Item = WidgetInfo>
Iterator over self and descendants, first self, then all in-bounds descendants, then all out-of-bounds descendants.
If the filter
returns false
the widget and all it’s in-bounds descendants are skipped, otherwise they are yielded. After
all in-bounds descendants reachable from self
and filtered the iterator changes to each out-of-bounds descendants and their
in-bounds descendants that are also filtered.
sourcepub fn inner_contains(&self, point: PxPoint) -> impl Iterator<Item = WidgetInfo>
pub fn inner_contains(&self, point: PxPoint) -> impl Iterator<Item = WidgetInfo>
Iterator over self and all descendants with inner bounds that contain the point
.
sourcepub fn inner_intersects(&self, rect: PxRect) -> impl Iterator<Item = WidgetInfo>
pub fn inner_intersects(&self, rect: PxRect) -> impl Iterator<Item = WidgetInfo>
Spatial iterator over self and descendants with inner bounds that intersects the rect
.
sourcepub fn inner_contains_rect(
&self,
rect: PxRect,
) -> impl Iterator<Item = WidgetInfo>
pub fn inner_contains_rect( &self, rect: PxRect, ) -> impl Iterator<Item = WidgetInfo>
Spatial iterator over self and descendants with inner bounds that fully envelops the rect
.
sourcepub fn inner_contained(&self, rect: PxRect) -> impl Iterator<Item = WidgetInfo>
pub fn inner_contained(&self, rect: PxRect) -> impl Iterator<Item = WidgetInfo>
Spatial iterator over self and descendants with inner bounds that are fully inside the rect
.
sourcepub fn center_contained(&self, area: PxRect) -> impl Iterator<Item = WidgetInfo>
pub fn center_contained(&self, area: PxRect) -> impl Iterator<Item = WidgetInfo>
Spatial iterator over self and descendants with center point inside the area
.
sourcepub fn center_in_distance(
&self,
origin: PxPoint,
max_radius: Px,
) -> impl Iterator<Item = WidgetInfo> + '_
pub fn center_in_distance( &self, origin: PxPoint, max_radius: Px, ) -> impl Iterator<Item = WidgetInfo> + '_
Spatial iterator over self and descendants with center point within the max_radius
of the origin
.
sourcepub fn hit_test(&self, point: PxPoint) -> HitTestInfo
pub fn hit_test(&self, point: PxPoint) -> HitTestInfo
Gets all widgets of self and descendants hit by a point
, sorted by z-index of the hit, front to back.
sourcepub fn nearest(&self, origin: PxPoint, max_radius: Px) -> Option<WidgetInfo>
pub fn nearest(&self, origin: PxPoint, max_radius: Px) -> Option<WidgetInfo>
Find the descendant with center point nearest of origin
within the max_radius
.
This method is faster than using sorting the result of center_in_distance
, but is slower if any point in distance is acceptable.
sourcepub fn nearest_filtered(
&self,
origin: PxPoint,
max_radius: Px,
filter: impl FnMut(&WidgetInfo) -> bool,
) -> Option<WidgetInfo>
pub fn nearest_filtered( &self, origin: PxPoint, max_radius: Px, filter: impl FnMut(&WidgetInfo) -> bool, ) -> Option<WidgetInfo>
Find the widget, self or descendant, with center point nearest of origin
within the max_radius
and approved by the filter
closure.
sourcepub fn nearest_bounded_filtered(
&self,
origin: PxPoint,
max_radius: Px,
bounds: PxRect,
filter: impl FnMut(&WidgetInfo) -> bool,
) -> Option<WidgetInfo>
pub fn nearest_bounded_filtered( &self, origin: PxPoint, max_radius: Px, bounds: PxRect, filter: impl FnMut(&WidgetInfo) -> bool, ) -> Option<WidgetInfo>
Find the widget, self or descendant, with center point nearest of origin
within the max_radius
and inside bounds
;
and approved by the filter
closure.
sourcepub fn oriented(
&self,
origin: PxPoint,
max_distance: Px,
orientation: Orientation2D,
) -> impl Iterator<Item = WidgetInfo>
pub fn oriented( &self, origin: PxPoint, max_distance: Px, orientation: Orientation2D, ) -> impl Iterator<Item = WidgetInfo>
Spatial iterator over all widgets, self and descendants, with center
in the direction defined by orientation
and
within max_distance
of the origin
, widgets are only visited once and the distance is clipped by the spatial_bounds
.
Use Px::MAX
on the distance to visit all widgets in the direction.
The direction is defined by a 45º frustum cast from the origin
, see Orientation2D::point_is
for more details.
sourcepub fn oriented_box(
&self,
origin: PxBox,
max_distance: Px,
orientation: Orientation2D,
) -> impl Iterator<Item = WidgetInfo>
pub fn oriented_box( &self, origin: PxBox, max_distance: Px, orientation: Orientation2D, ) -> impl Iterator<Item = WidgetInfo>
Spatial iterator over all widgets, self and descendants, with inner_bounds
in the direction defined by orientation
in relation to origin
and with center
within max_distance
of the origin
center. Widgets are only visited once and
the distance is clipped by the spatial_bounds
.
Use Px::MAX
on the distance to visit all widgets in the direction.
The direction is a collision check between inner-bounds and origin, see Orientation2D::box_is
for more details.
sourcepub fn nearest_oriented(
&self,
origin: PxPoint,
max_distance: Px,
orientation: Orientation2D,
) -> Option<WidgetInfo>
pub fn nearest_oriented( &self, origin: PxPoint, max_distance: Px, orientation: Orientation2D, ) -> Option<WidgetInfo>
Find the widget with center point nearest of origin
within the max_distance
and with orientation
to origin.
This method is faster than searching the result of oriented
.
sourcepub fn nearest_oriented_filtered(
&self,
origin: PxPoint,
max_distance: Px,
orientation: Orientation2D,
filter: impl FnMut(&WidgetInfo) -> bool,
) -> Option<WidgetInfo>
pub fn nearest_oriented_filtered( &self, origin: PxPoint, max_distance: Px, orientation: Orientation2D, filter: impl FnMut(&WidgetInfo) -> bool, ) -> Option<WidgetInfo>
Find the widget with center point nearest of origin
within the max_distance
and with orientation
to origin,
and approved by the filter
closure.
This method is faster than searching the result of oriented
.
sourcepub fn nearest_box_oriented(
&self,
origin: PxBox,
max_distance: Px,
orientation: Orientation2D,
) -> Option<WidgetInfo>
pub fn nearest_box_oriented( &self, origin: PxBox, max_distance: Px, orientation: Orientation2D, ) -> Option<WidgetInfo>
Find the widget with center point nearest to origin
center within the max_distance
and with box orientation
to origin.
This method is faster than searching the result of oriented_box
.
sourcepub fn nearest_box_oriented_filtered(
&self,
origin: PxBox,
max_distance: Px,
orientation: Orientation2D,
filter: impl FnMut(&WidgetInfo) -> bool,
) -> Option<WidgetInfo>
pub fn nearest_box_oriented_filtered( &self, origin: PxBox, max_distance: Px, orientation: Orientation2D, filter: impl FnMut(&WidgetInfo) -> bool, ) -> Option<WidgetInfo>
Find the widget with center point nearest to origin
center within the max_distance
and with box orientation
to origin,
and approved by the filter
closure.
This method is faster than searching the result of oriented_box
.
Trait Implementations§
source§impl Clone for WidgetInfo
impl Clone for WidgetInfo
source§fn clone(&self) -> WidgetInfo
fn clone(&self) -> WidgetInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WidgetInfo
impl Debug for WidgetInfo
source§impl Hash for WidgetInfo
impl Hash for WidgetInfo
source§impl PartialEq for WidgetInfo
impl PartialEq for WidgetInfo
source§impl WidgetInfoInspectorExt for WidgetInfo
impl WidgetInfoInspectorExt for WidgetInfo
source§fn inspector_info(&self) -> Option<Arc<InspectorInfo>>
fn inspector_info(&self) -> Option<Arc<InspectorInfo>>
source§fn can_inspect(&self) -> bool
fn can_inspect(&self) -> bool
inspector_info
is defined for the widget.source§fn inspect_child<P: InspectWidgetPattern>(
&self,
pattern: P,
) -> Option<WidgetInfo>
fn inspect_child<P: InspectWidgetPattern>( &self, pattern: P, ) -> Option<WidgetInfo>
source§fn inspect_descendant<P: InspectWidgetPattern>(
&self,
pattern: P,
) -> Option<WidgetInfo>
fn inspect_descendant<P: InspectWidgetPattern>( &self, pattern: P, ) -> Option<WidgetInfo>
source§fn inspect_ancestor<P: InspectWidgetPattern>(
&self,
pattern: P,
) -> Option<WidgetInfo>
fn inspect_ancestor<P: InspectWidgetPattern>( &self, pattern: P, ) -> Option<WidgetInfo>
source§fn inspect_property<P: InspectPropertyPattern>(
&self,
pattern: P,
) -> Option<&dyn PropertyArgs>
fn inspect_property<P: InspectPropertyPattern>( &self, pattern: P, ) -> Option<&dyn PropertyArgs>
source§fn parent_property(&self) -> Option<(PropertyId, usize)>
fn parent_property(&self) -> Option<(PropertyId, usize)>
source§impl WidgetPathProvider for WidgetInfo
impl WidgetPathProvider for WidgetInfo
source§type WidgetIter<'s> = Map<Ancestors, fn(_: WidgetInfo) -> WidgetId>
type WidgetIter<'s> = Map<Ancestors, fn(_: WidgetInfo) -> WidgetId>
widget_and_ancestors
.source§fn widget_and_ancestors(&self) -> Self::WidgetIter<'_>
fn widget_and_ancestors(&self) -> Self::WidgetIter<'_>
impl Eq for WidgetInfo
Auto Trait Implementations§
impl Freeze for WidgetInfo
impl !RefUnwindSafe for WidgetInfo
impl Send for WidgetInfo
impl Sync for WidgetInfo
impl Unpin for WidgetInfo
impl !UnwindSafe for WidgetInfo
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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