pub struct Hitbox {
pub id: HitboxId,
pub bounds: Bounds<Pixels>,
pub content_mask: ContentMask<Pixels>,
pub behavior: HitboxBehavior,
pub fragments: Option<Arc<[Bounds<Pixels>]>>,
pub tags: Vec<SharedString>,
}Expand description
A region that receives mouse input for the frame it was inserted in.
Create one with Window::insert_hitbox during prepaint. Hitboxes are how
GPUI decides which element is under the pointer: the pointer is tested against
the hitboxes of the last frame, and listeners registered during paint are
offered the event only when their element’s hitbox was hit. A Hitbox
derefs to its bounds, so hitbox.size and
hitbox.origin work directly.
See input dispatch for the full order of events and the frame for when hitboxes are created.
Fields§
§id: HitboxIdThe unique id of this hitbox in its frame.
bounds: Bounds<Pixels>The rectangle this hitbox covers, in window coordinates.
content_mask: ContentMask<Pixels>The content mask that was active when the hitbox was inserted.
Parts of the hitbox outside this mask, such as an area scrolled out of a container, don’t receive input.
behavior: HitboxBehaviorHow this hitbox affects hitboxes behind it.
fragments: Option<Arc<[Bounds<Pixels>]>>The disjoint rectangles of an inline element, when it spans several lines.
When this is Some, the hitbox covers these rectangles instead of bounds,
which is their bounding box.
Tags attached to this hitbox, which you can read back with HitTestEntry::tags.
Implementations§
Source§impl Hitbox
impl Hitbox
Sourcepub fn contains(&self, point: &Point<Pixels>) -> bool
pub fn contains(&self, point: &Point<Pixels>) -> bool
Returns whether point lies inside this hitbox’s content mask and its bounds.
This check ignores occlusion, so a point can be inside a hitbox that is
covered by another one. Use Hitbox::is_hovered to check what the
mouse is actually over.
Sourcepub fn is_hovered(&self, window: &Window) -> bool
pub fn is_hovered(&self, window: &Window) -> bool
Returns whether the mouse is over this hitbox, for hover styles and mouse handlers.
This returns false when a hitbox in front of this one blocks the mouse,
with InteractiveElement::occlude or InteractiveElement::block_mouse_except_scroll.
It also returns false during keyboard input, so keyboard navigation doesn’t
show hover styles. Use this for clicks, moves and hover styling. For scroll
handling, use Hitbox::should_handle_scroll, because a scrollable container
under an overlay should still scroll.
Sourcepub fn is_hovered_at(&self, position: Point<Pixels>, window: &Window) -> bool
pub fn is_hovered_at(&self, position: Point<Pixels>, window: &Window) -> bool
Checks whether this hitbox would be hovered at position, regardless of the current input
modality or mouse position.
Sourcepub fn should_handle_scroll(&self, window: &Window) -> bool
pub fn should_handle_scroll(&self, window: &Window) -> bool
Returns whether the mouse is over this hitbox and this hitbox should handle scroll events.
Use it in ScrollWheelEvent handlers. It returns false only when a
HitboxBehavior::BlockMouse hitbox is in front of this one, so overlays
can block clicks without blocking scrolling underneath.
Methods from Deref<Target = Bounds<Pixels>>§
Sourcepub fn top_center(&self) -> Point<T>
pub fn top_center(&self) -> Point<T>
Returns the midpoint of the top edge.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.top_center(), Point { x: 5, y: 0 });Sourcepub fn bottom_center(&self) -> Point<T>
pub fn bottom_center(&self) -> Point<T>
Returns the midpoint of the bottom edge.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.bottom_center(), Point { x: 5, y: 20 });Sourcepub fn left_center(&self) -> Point<T>
pub fn left_center(&self) -> Point<T>
Returns the midpoint of the left edge.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.left_center(), Point { x: 0, y: 10 });Sourcepub fn right_center(&self) -> Point<T>
pub fn right_center(&self) -> Point<T>
Returns the midpoint of the right edge.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.right_center(), Point { x: 10, y: 10 });Sourcepub fn intersects(&self, other: &Bounds<T>) -> bool
pub fn intersects(&self, other: &Bounds<T>) -> bool
Returns true if this rectangle and other share some area.
Bounds that only touch along an edge don’t intersect.
§Examples
let bounds1 = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 10 },
};
let bounds2 = Bounds {
origin: Point { x: 5, y: 5 },
size: Size { width: 10, height: 10 },
};
let bounds3 = Bounds {
origin: Point { x: 20, y: 20 },
size: Size { width: 10, height: 10 },
};
assert_eq!(bounds1.intersects(&bounds2), true);
assert_eq!(bounds1.intersects(&bounds3), false);Sourcepub fn center(&self) -> Point<T>
pub fn center(&self) -> Point<T>
Returns the center point of the bounds.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.center(), Point { x: 5, y: 10 });Sourcepub fn half_perimeter(&self) -> T
pub fn half_perimeter(&self) -> T
Returns the width plus the height.
The perimeter of the bounds is twice this value.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.half_perimeter(), 30);Sourcepub fn dilate(&self, amount: T) -> Bounds<T>
pub fn dilate(&self, amount: T) -> Bounds<T>
Returns the bounds grown by amount on every side.
The origin moves by -amount and the width and height grow by twice amount, so the
center stays in place. A negative amount shrinks the bounds. Use Bounds::inset to
shrink by a positive amount.
§Examples
let bounds = Bounds {
origin: Point { x: 10, y: 10 },
size: Size { width: 10, height: 10 },
};
assert_eq!(bounds.dilate(5), Bounds {
origin: Point { x: 5, y: 5 },
size: Size { width: 20, height: 20 },
});Sourcepub fn extend(&self, amount: Edges<T>) -> Bounds<T>
pub fn extend(&self, amount: Edges<T>) -> Bounds<T>
Returns the bounds grown by a different amount on each side.
Each side of amount moves the matching edge outward: top grows upward, right grows to
the right, and so on.
§Examples
let bounds = Bounds {
origin: Point { x: 10, y: 10 },
size: Size { width: 10, height: 10 },
};
let amount = Edges { top: 1, right: 2, bottom: 3, left: 4 };
assert_eq!(bounds.extend(amount), Bounds {
origin: Point { x: 6, y: 9 },
size: Size { width: 16, height: 14 },
});Sourcepub fn inset(&self, amount: T) -> Self
pub fn inset(&self, amount: T) -> Self
Returns the bounds shrunk by amount on every side.
Same as Bounds::dilate with amount negated.
§Examples
let bounds = Bounds {
origin: Point { x: 0.0, y: 0.0 },
size: Size { width: 10.0, height: 10.0 },
};
assert_eq!(bounds.inset(2.0), Bounds {
origin: Point { x: 2.0, y: 2.0 },
size: Size { width: 6.0, height: 6.0 },
});Sourcepub fn intersect(&self, other: &Self) -> Self
pub fn intersect(&self, other: &Self) -> Self
Returns the area that this rectangle and other share.
If the bounds don’t overlap, the result has zero width or zero height. Its origin is then the larger of the two origins in each coordinate, which may lie outside both bounds.
§Examples
let bounds1 = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 10 },
};
let bounds2 = Bounds {
origin: Point { x: 5, y: 5 },
size: Size { width: 10, height: 10 },
};
assert_eq!(bounds1.intersect(&bounds2), Bounds {
origin: Point { x: 5, y: 5 },
size: Size { width: 5, height: 5 },
});Sourcepub fn union(&self, other: &Self) -> Self
pub fn union(&self, other: &Self) -> Self
Returns the smallest bounds that contain both rectangles.
§Examples
let bounds1 = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 10 },
};
let bounds2 = Bounds {
origin: Point { x: 5, y: 5 },
size: Size { width: 15, height: 15 },
};
assert_eq!(bounds1.union(&bounds2), Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 20, height: 20 },
});Sourcepub fn space_within(&self, outer: &Self) -> Edges<T>
pub fn space_within(&self, outer: &Self) -> Edges<T>
Returns the distance from each edge of this rectangle to the matching edge of outer.
A positive value means this rectangle lies inside outer on that side. A negative value means
it extends past outer.
§Examples
let outer = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 100, height: 100 },
};
let inner = Bounds {
origin: Point { x: 10, y: 20 },
size: Size { width: 30, height: 40 },
};
assert_eq!(inner.space_within(&outer), Edges { top: 20, right: 60, bottom: 40, left: 10 });Sourcepub fn bottom(&self) -> T
pub fn bottom(&self) -> T
Returns the y coordinate of the bottom edge, which is outside the bounds.
Sourcepub fn right(&self) -> T
pub fn right(&self) -> T
Returns the x coordinate of the right edge, which is outside the bounds.
Sourcepub fn top_right(&self) -> Point<T>
pub fn top_right(&self) -> Point<T>
Returns the top right corner point of the bounds.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.top_right(), Point { x: 10, y: 0 });Sourcepub fn bottom_right(&self) -> Point<T>
pub fn bottom_right(&self) -> Point<T>
Returns the bottom right corner point of the bounds.
This point is outside the bounds: Bounds::contains returns false for it.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.bottom_right(), Point { x: 10, y: 20 });Sourcepub fn bottom_left(&self) -> Point<T>
pub fn bottom_left(&self) -> Point<T>
Returns the bottom left corner point of the bounds.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.bottom_left(), Point { x: 0, y: 20 });Sourcepub fn corner(&self, corner: Anchor) -> Point<T>
pub fn corner(&self, corner: Anchor) -> Point<T>
Returns the point at corner on this rectangle.
Accepts the four corners and the four edge midpoints.
§Examples
use gpui::{Anchor, Bounds, Point, Size};
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 20 },
};
assert_eq!(bounds.corner(Anchor::BottomLeft), Point { x: 0, y: 20 });Sourcepub fn contains(&self, point: &Point<T>) -> bool
pub fn contains(&self, point: &Point<T>) -> bool
Returns true if point lies inside the bounds.
The left and top edges are inside, and the right and bottom edges are outside. A point at
(right, y) or (x, bottom) returns false. With integer coordinates, a rectangle of
width 10 at x = 0 contains x = 0 through x = 9 only.
§Examples
let bounds = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 10 },
};
assert!(bounds.contains(&Point { x: 5, y: 5 }));
assert!(bounds.contains(&Point { x: 0, y: 0 }));
assert!(!bounds.contains(&Point { x: 10, y: 5 }));
assert!(!bounds.contains(&Point { x: 15, y: 15 }));Sourcepub fn is_contained_within(&self, other: &Self) -> bool
pub fn is_contained_within(&self, other: &Self) -> bool
Returns true if this rectangle lies entirely inside other.
Checks that the top left and bottom right corners of this rectangle are inside other, using
the rules of Bounds::contains.
§Examples
let outer = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 20, height: 20 },
};
let inner = Bounds {
origin: Point { x: 5, y: 5 },
size: Size { width: 10, height: 10 },
};
let overlapping = Bounds {
origin: Point { x: 15, y: 15 },
size: Size { width: 10, height: 10 },
};
assert!(inner.is_contained_within(&outer));
assert!(!overlapping.is_contained_within(&outer));Sourcepub fn map<U>(&self, f: impl Fn(T) -> U) -> Bounds<U>
pub fn map<U>(&self, f: impl Fn(T) -> U) -> Bounds<U>
Returns bounds with f applied to the origin and the size, converting T to U.
§Examples
let bounds = Bounds {
origin: Point { x: 10.0, y: 10.0 },
size: Size { width: 10.0, height: 20.0 },
};
let new_bounds = bounds.map(|value| value as f64 * 1.5);
assert_eq!(new_bounds, Bounds {
origin: Point { x: 15.0, y: 15.0 },
size: Size { width: 15.0, height: 30.0 },
});Sourcepub fn map_origin(self, f: impl Fn(T) -> T) -> Bounds<T>
pub fn map_origin(self, f: impl Fn(T) -> T) -> Bounds<T>
Returns bounds with f applied to each coordinate of the origin. The size is unchanged.
§Examples
let bounds = Bounds {
origin: Point { x: 10.0, y: 10.0 },
size: Size { width: 10.0, height: 20.0 },
};
let new_bounds = bounds.map_origin(|value| value * 1.5);
assert_eq!(new_bounds, Bounds {
origin: Point { x: 15.0, y: 15.0 },
size: Size { width: 10.0, height: 20.0 },
});Sourcepub fn map_size(self, f: impl Fn(T) -> T) -> Bounds<T>
pub fn map_size(self, f: impl Fn(T) -> T) -> Bounds<T>
Returns bounds with f applied to the width and the height. The origin is unchanged.
§Examples
let bounds = Bounds {
origin: Point { x: 10.0, y: 10.0 },
size: Size { width: 10.0, height: 20.0 },
};
let new_bounds = bounds.map_size(|value| value * 1.5);
assert_eq!(new_bounds, Bounds {
origin: Point { x: 10.0, y: 10.0 },
size: Size { width: 15.0, height: 30.0 },
});Sourcepub fn localize(&self, point: &Point<T>) -> Option<Point<T>>
pub fn localize(&self, point: &Point<T>) -> Option<Point<T>>
Returns point relative to the origin of this rectangle, or None if point is outside.
Use it to turn a window position into a position inside an element. The result follows
the rules of Bounds::contains.
§Examples
let panel = bounds(point(px(100.), px(50.)), size(px(200.), px(100.)));
assert_eq!(panel.localize(&point(px(110.), px(60.))), Some(point(px(10.), px(10.))));
assert_eq!(panel.localize(&point(px(10.), px(10.))), None);Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the width or the height is zero or less.
§Examples
let empty = Bounds {
origin: Point { x: 0, y: 0 },
size: Size { width: 10, height: 0 },
};
assert!(empty.is_empty());Sourcepub fn scale(&self, factor: f32) -> Bounds<ScaledPixels>
pub fn scale(&self, factor: f32) -> Bounds<ScaledPixels>
Multiplies the origin and the size by factor, producing ScaledPixels.
Pass the display’s scale factor to convert logical bounds into the scaled space. The values
aren’t rounded: use Bounds::to_device_pixels to get whole device pixels.
§Examples
let bounds = Bounds {
origin: Point { x: Pixels::from(10.0), y: Pixels::from(20.0) },
size: Size { width: Pixels::from(30.0), height: Pixels::from(40.0) },
};
let scaled_bounds = bounds.scale(2.0);
assert_eq!(scaled_bounds, Bounds {
origin: Point {
x: ScaledPixels::from(20.0),
y: ScaledPixels::from(40.0),
},
size: Size {
width: ScaledPixels::from(60.0),
height: ScaledPixels::from(80.0)
},
});Sourcepub fn to_device_pixels(self, factor: f32) -> Bounds<DevicePixels>
pub fn to_device_pixels(self, factor: f32) -> Bounds<DevicePixels>
Converts these logical bounds to device pixels.
Multiplies each coordinate and size by factor, rounding each to the nearest whole device
pixel. The origin and the size are rounded separately, so the bottom right corner can differ
by one pixel from rounding the corner directly.
§Examples
let logical = bounds(point(px(10.), px(20.)), size(px(30.), px(40.)));
assert_eq!(
logical.to_device_pixels(1.5),
bounds(point(DevicePixels(15), DevicePixels(30)), size(DevicePixels(45), DevicePixels(60))),
);Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hitbox
impl RefUnwindSafe for Hitbox
impl Send for Hitbox
impl Sync for Hitbox
impl Unpin for Hitbox
impl UnsafeUnpin for Hitbox
impl UnwindSafe for Hitbox
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>,
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Source§impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
Source§type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
Source§fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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, C> ComponentsInto<C> for T
impl<T, C> ComponentsInto<C> for T
Source§fn components_into(self) -> C
fn components_into(self) -> C
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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