pub struct Tab { /* private fields */ }Expand description
A single tab within a TabBar.
Renders per TabBarStyle (default TabBarStyle::Underline); pass the
same style used on the parent TabBar via Tab::style so both agree.
Implementations§
Source§impl Tab
impl Tab
pub fn new(id: impl Into<ElementId>) -> Self
Sourcepub fn style(self, style: TabBarStyle) -> Self
pub fn style(self, style: TabBarStyle) -> Self
Sets the visual style. Should match the parent TabBar’s style.
Sourcepub fn position(self, position: TabPosition) -> Self
pub fn position(self, position: TabPosition) -> Self
Sets this tab’s position within its row (see TabPosition).
Sourcepub fn close_side(self, close_side: TabCloseSide) -> Self
pub fn close_side(self, close_side: TabCloseSide) -> Self
Sets which side the end slot (e.g. close button) sits on relative to
the fixed-size start/end slots (see TabCloseSide).
pub fn start_slot<E: IntoElement>(self, element: impl Into<Option<E>>) -> Self
pub fn end_slot<E: IntoElement>(self, element: impl Into<Option<E>>) -> Self
pub fn content_height(cx: &App) -> Pixels
pub fn container_height(cx: &App) -> Pixels
Trait Implementations§
Source§impl Component for Tab
impl Component for Tab
Source§fn scope() -> ComponentScope
fn scope() -> ComponentScope
Returns the scope of the component. Read more
Source§fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement>
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement>
The component’s preview. Read more
Source§fn id() -> ComponentId
fn id() -> ComponentId
The component’s unique identifier. Read more
Source§fn status() -> ComponentStatus
fn status() -> ComponentStatus
The ready status of this component. Read more
Source§impl InteractiveElement for Tab
impl InteractiveElement for Tab
Source§fn interactivity(&mut self) -> &mut Interactivity
fn interactivity(&mut self) -> &mut Interactivity
Retrieve the interactivity state associated with this element
Source§fn group(self, group: impl Into<SharedString>) -> Self
fn group(self, group: impl Into<SharedString>) -> Self
Assign this element to a group of elements that can be styled together
Source§fn id(self, id: impl Into<ElementId>) -> Stateful<Self>
fn id(self, id: impl Into<ElementId>) -> Stateful<Self>
Assign this element an ID, so that it can be used with interactivity
Source§fn track_focus(self, focus_handle: &FocusHandle) -> Self
fn track_focus(self, focus_handle: &FocusHandle) -> Self
Track the focus state of the given focus handle on this element.
If the focus handle is focused by the application, this element will
apply its focused styles.
Source§fn tab_index(self, index: isize) -> Self
fn tab_index(self, index: isize) -> Self
Set index of the tab stop order, and set this node as a tab stop.
This will default the element to being a tab stop. See
Self::tab_stop for more information.
This should only be used in conjunction with tab_group
in order to not interfere with the tab index of other elements.Source§fn tab_group(self) -> Self
fn tab_group(self) -> Self
Designate this div as a “tab group”. Tab groups have their own location in the tab-index order,
but for children of the tab group, the tab index is reset to 0. This can be useful for swapping
the order of tab stops within the group, without having to renumber all the tab stops in the whole
application.
Source§fn key_context<C, E>(self, key_context: C) -> Self
fn key_context<C, E>(self, key_context: C) -> Self
Set the keymap context for this element. This will be used to determine
which action to dispatch from the keymap.
Source§fn hover(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
fn hover(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Self
Apply the given style to this element when the mouse hovers over it
Source§fn group_hover(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Self
fn group_hover( self, group_name: impl Into<SharedString>, f: impl FnOnce(StyleRefinement) -> StyleRefinement, ) -> Self
Apply the given style to this element when the mouse hovers over a group member
Source§fn on_mouse_down(
self,
button: MouseButton,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_down( self, button: MouseButton, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event for the given mouse button.
The fluent API equivalent to
Interactivity::on_mouse_down. Read moreSource§fn debug_selector(self, _: impl FnOnce() -> String) -> Self
fn debug_selector(self, _: impl FnOnce() -> String) -> Self
Set a key that can be used to look up this element’s bounds
in the [
crate::VisualTestContext::debug_bounds] map
This is a noop in release buildsSource§fn capture_any_mouse_down(
self,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_any_mouse_down( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event for any button, during the capture phase.
The fluent API equivalent to
Interactivity::capture_any_mouse_down. Read moreSource§fn on_any_mouse_down(
self,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_any_mouse_down( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event for any button, during the capture phase.
The fluent API equivalent to
Interactivity::on_any_mouse_down. Read moreSource§fn on_mouse_up(
self,
button: MouseButton,
listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_up( self, button: MouseButton, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse up event for the given button, during the bubble phase.
The fluent API equivalent to
Interactivity::on_mouse_up. Read moreSource§fn capture_any_mouse_up(
self,
listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_any_mouse_up( self, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse up event for any button, during the capture phase.
The fluent API equivalent to
Interactivity::capture_any_mouse_up. Read moreSource§fn on_mouse_pressure(
self,
listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_pressure( self, listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse pressure event, during the bubble phase
the fluent API equivalent to
Interactivity::on_mouse_pressure Read moreSource§fn capture_mouse_pressure(
self,
listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_mouse_pressure( self, listener: impl Fn(&MousePressureEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse pressure event, during the capture phase
the fluent API equivalent to
Interactivity::on_mouse_pressure Read moreSource§fn on_mouse_down_out(
self,
listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_down_out( self, listener: impl Fn(&MouseDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse down event, on any button, during the capture phase,
when the mouse is outside of the bounds of this element.
The fluent API equivalent to
Interactivity::on_mouse_down_out. Read moreSource§fn on_mouse_up_out(
self,
button: MouseButton,
listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_up_out( self, button: MouseButton, listener: impl Fn(&MouseUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse up event, for the given button, during the capture phase,
when the mouse is outside of the bounds of this element.
The fluent API equivalent to
Interactivity::on_mouse_up_out. Read moreSource§fn on_mouse_move(
self,
listener: impl Fn(&MouseMoveEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_mouse_move( self, listener: impl Fn(&MouseMoveEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to the mouse move event, during the bubble phase.
The fluent API equivalent to
Interactivity::on_mouse_move. Read moreSource§fn on_drag_move<T>(
self,
listener: impl Fn(&DragMoveEvent<T>, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
fn on_drag_move<T>(
self,
listener: impl Fn(&DragMoveEvent<T>, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
Bind the given callback to the mouse drag event of the given type. Note that this
will be called for all move events, inside or outside of this element, as long as the
drag was started with this element under the mouse. Useful for implementing draggable
UIs that don’t conform to a drag and drop style interaction, like resizing.
The fluent API equivalent to
Interactivity::on_drag_move. Read moreSource§fn on_scroll_wheel(
self,
listener: impl Fn(&ScrollWheelEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_scroll_wheel( self, listener: impl Fn(&ScrollWheelEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to scroll wheel events during the bubble phase.
The fluent API equivalent to
Interactivity::on_scroll_wheel. Read moreSource§fn on_pinch(
self,
listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_pinch( self, listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to pinch gesture events during the bubble phase.
The fluent API equivalent to
Interactivity::on_pinch. Read moreSource§fn capture_pinch(
self,
listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_pinch( self, listener: impl Fn(&PinchEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to pinch gesture events during the capture phase.
The fluent API equivalent to
Interactivity::capture_pinch. Read moreSource§fn capture_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
fn capture_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
Capture the given action, before normal action dispatch can fire.
The fluent API equivalent to
Interactivity::capture_action. Read moreSource§fn on_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
fn on_action<A>(
self,
listener: impl Fn(&A, &mut Window, &mut App) + 'static,
) -> Selfwhere
A: Action,
Bind the given callback to an action dispatch during the bubble phase.
The fluent API equivalent to
Interactivity::on_action. Read moreSource§fn on_boxed_action(
self,
action: &(dyn Action + 'static),
listener: impl Fn(&(dyn Action + 'static), &mut Window, &mut App) + 'static,
) -> Self
fn on_boxed_action( self, action: &(dyn Action + 'static), listener: impl Fn(&(dyn Action + 'static), &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to an action dispatch, based on a dynamic action parameter
instead of a type parameter. Useful for component libraries that want to expose
action bindings to their users.
The fluent API equivalent to
Interactivity::on_boxed_action. Read moreSource§fn on_key_down(
self,
listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_key_down( self, listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key down events during the bubble phase.
The fluent API equivalent to
Interactivity::on_key_down. Read moreSource§fn capture_key_down(
self,
listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_key_down( self, listener: impl Fn(&KeyDownEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key down events during the capture phase.
The fluent API equivalent to
Interactivity::capture_key_down. Read moreSource§fn on_key_up(
self,
listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_key_up( self, listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key up events during the bubble phase.
The fluent API equivalent to
Interactivity::on_key_up. Read moreSource§fn capture_key_up(
self,
listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static,
) -> Self
fn capture_key_up( self, listener: impl Fn(&KeyUpEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to key up events during the capture phase.
The fluent API equivalent to
Interactivity::capture_key_up. Read moreSource§fn on_modifiers_changed(
self,
listener: impl Fn(&ModifiersChangedEvent, &mut Window, &mut App) + 'static,
) -> Self
fn on_modifiers_changed( self, listener: impl Fn(&ModifiersChangedEvent, &mut Window, &mut App) + 'static, ) -> Self
Bind the given callback to modifiers changing events.
The fluent API equivalent to
Interactivity::on_modifiers_changed. Read moreSource§fn drag_over<S>(
self,
f: impl Fn(StyleRefinement, &S, &mut Window, &mut App) -> StyleRefinement + 'static,
) -> Selfwhere
S: 'static,
fn drag_over<S>(
self,
f: impl Fn(StyleRefinement, &S, &mut Window, &mut App) -> StyleRefinement + 'static,
) -> Selfwhere
S: 'static,
Apply the given style when the given data type is dragged over this element
Source§fn group_drag_over<S>(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
S: 'static,
fn group_drag_over<S>(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
S: 'static,
Apply the given style when the given data type is dragged over this element’s group
Source§fn on_drop<T>(
self,
listener: impl Fn(&T, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
fn on_drop<T>(
self,
listener: impl Fn(&T, &mut Window, &mut App) + 'static,
) -> Selfwhere
T: 'static,
Bind the given callback to drop events of the given type, whether or not the drag started on this element.
The fluent API equivalent to
Interactivity::on_drop. Read moreSource§fn can_drop(
self,
predicate: impl Fn(&(dyn Any + 'static), &mut Window, &mut App) -> bool + 'static,
) -> Self
fn can_drop( self, predicate: impl Fn(&(dyn Any + 'static), &mut Window, &mut App) -> bool + 'static, ) -> Self
Use the given predicate to determine whether or not a drop event should be dispatched to this element.
The fluent API equivalent to
Interactivity::can_drop.Source§fn occlude(self) -> Self
fn occlude(self) -> Self
Block the mouse from all interactions with elements behind this element’s hitbox. Typically
block_mouse_except_scroll should be preferred.
The fluent API equivalent to Interactivity::occlude_mouse.Source§fn window_control_area(self, area: WindowControlArea) -> Self
fn window_control_area(self, area: WindowControlArea) -> Self
Set the bounds of this element as a window control area for the platform window.
The fluent API equivalent to
Interactivity::window_control_area.Source§fn block_mouse_except_scroll(self) -> Self
fn block_mouse_except_scroll(self) -> Self
Block non-scroll mouse interactions with elements behind this element’s hitbox.
The fluent API equivalent to
Interactivity::block_mouse_except_scroll. Read moreSource§fn focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
fn focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element, specifically, is focused.
Requires that the element is focusable. Elements can be made focusable using
InteractiveElement::track_focus.Source§fn in_focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
fn in_focus(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element is inside another element that is focused.
Requires that the element is focusable. Elements can be made focusable using
InteractiveElement::track_focus.Source§fn focus_visible(
self,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
fn focus_visible(
self,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element is focused via keyboard navigation.
This is similar to CSS’s
:focus-visible pseudo-class - it only applies when the element
is focused AND the user is navigating via keyboard (not mouse clicks).
Requires that the element is focusable. Elements can be made focusable using InteractiveElement::track_focus.Source§impl IntoElement for Tab
impl IntoElement for Tab
Source§type Element = Component<Tab>
type Element = Component<Tab>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl ParentElement for Tab
impl ParentElement for Tab
Source§fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>)
fn extend(&mut self, elements: impl IntoIterator<Item = AnyElement>)
Extend this element’s children with the given child elements.
Source§fn child(self, child: impl IntoElement) -> Selfwhere
Self: Sized,
fn child(self, child: impl IntoElement) -> Selfwhere
Self: Sized,
Add a single child element to this element.
Source§fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Selfwhere
Self: Sized,
fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Selfwhere
Self: Sized,
Add multiple child elements to this element.
Source§impl RenderOnce for Tab
impl RenderOnce for Tab
Source§impl StatefulInteractiveElement for Tab
impl StatefulInteractiveElement for Tab
Source§fn overflow_scroll(self) -> Self
fn overflow_scroll(self) -> Self
Set the overflow x and y to scroll.
Source§fn overflow_x_scroll(self) -> Self
fn overflow_x_scroll(self) -> Self
Set the overflow x to scroll.
Source§fn overflow_y_scroll(self) -> Self
fn overflow_y_scroll(self) -> Self
Set the overflow y to scroll.
Source§fn track_scroll(self, scroll_handle: &ScrollHandle) -> Self
fn track_scroll(self, scroll_handle: &ScrollHandle) -> Self
Track the scroll state of this element with the given handle.
Source§fn anchor_scroll(self, scroll_anchor: Option<ScrollAnchor>) -> Self
fn anchor_scroll(self, scroll_anchor: Option<ScrollAnchor>) -> Self
Track the scroll state of this element with the given handle.
Source§fn active(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
fn active(self, f: impl FnOnce(StyleRefinement) -> StyleRefinement) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element is active.
Source§fn group_active(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
fn group_active(
self,
group_name: impl Into<SharedString>,
f: impl FnOnce(StyleRefinement) -> StyleRefinement,
) -> Selfwhere
Self: Sized,
Set the given styles to be applied when this element’s group is active.
Source§fn on_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Bind the given callback to click events of this element.
The fluent API equivalent to
Interactivity::on_click. Read moreSource§fn on_aux_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_aux_click(
self,
listener: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Bind the given callback to non-primary click events of this element.
The fluent API equivalent to
Interactivity::on_aux_click. Read moreSource§fn on_drag<T, W>(
self,
value: T,
constructor: impl Fn(&T, Point<Pixels>, &mut Window, &mut App) -> Entity<W> + 'static,
) -> Self
fn on_drag<T, W>( self, value: T, constructor: impl Fn(&T, Point<Pixels>, &mut Window, &mut App) -> Entity<W> + 'static, ) -> Self
On drag initiation, this callback will be used to create a new view to render the dragged value for a
drag and drop operation. This API should also be used as the equivalent of ‘on drag start’ with
the
InteractiveElement::on_drag_move API.
The callback also has access to the offset of triggering click from the origin of parent element.
The fluent API equivalent to Interactivity::on_drag. Read moreSource§fn on_hover(
self,
listener: impl Fn(&bool, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
fn on_hover(
self,
listener: impl Fn(&bool, &mut Window, &mut App) + 'static,
) -> Selfwhere
Self: Sized,
Bind the given callback on the hover start and end events of this element. Note that the boolean
passed to the callback is true when the hover starts and false when it ends.
The fluent API equivalent to
Interactivity::on_hover. Read moreSource§fn tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
fn tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
Use the given callback to construct a new tooltip view when the mouse hovers over this element.
The fluent API equivalent to
Interactivity::tooltip.Source§fn hoverable_tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
fn hoverable_tooltip(
self,
build_tooltip: impl Fn(&mut Window, &mut App) -> AnyView + 'static,
) -> Selfwhere
Self: Sized,
Use the given callback to construct a new tooltip view when the mouse hovers over this element.
The tooltip itself is also hoverable and won’t disappear when the user moves the mouse into
the tooltip. The fluent API equivalent to
Interactivity::hoverable_tooltip.Source§impl Toggleable for Tab
impl Toggleable for Tab
Source§fn toggle_state(self, selected: bool) -> Self
fn toggle_state(self, selected: bool) -> Self
Sets whether the element is selected.
Auto Trait Implementations§
impl !RefUnwindSafe for Tab
impl !Send for Tab
impl !Sync for Tab
impl !UnwindSafe for Tab
impl Freeze for Tab
impl Unpin for Tab
impl UnsafeUnpin for Tab
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>,
Convert the source color to the destination color using the specified
method.
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default.
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
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
Cast a collection of colors into a collection of arrays.
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
Cast this collection of arrays into a collection of colors.
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
Mutably borrows from an owned value. Read more
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
The number type that’s used in
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
Converts
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> CommonAnimationExt for Twhere
T: AnimationExt,
impl<T> CommonAnimationExt for Twhere
T: AnimationExt,
Source§fn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>where
Self: Transformable + Sized,
fn with_rotate_animation(self, duration: u64) -> AnimationElement<Self>where
Self: Transformable + Sized,
Render this component as rotating over the given duration. Read more
Source§fn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>where
Self: Transformable + Sized,
fn with_keyed_rotate_animation(
self,
id: impl Into<ElementId>,
duration: u64,
) -> AnimationElement<Self>where
Self: Transformable + Sized,
Render this component as rotating with the given element ID over the given duration.
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
Cast a collection of colors into a collection of color components.
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
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
Performs a conversion from
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
Converts
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
Performs a conversion into
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
The number type that’s used in
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
Converts
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
Convert into T with values clamped to the color defined bounds Read more
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
Convert into T. The resulting color might be invalid in its color space Read more
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>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read 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>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts
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
The error for when
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>
Try to cast this collection of color components into a collection of
colors. Read more
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>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds error is returned which contains
the unclamped color. Read moreSource§impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
Source§fn uints_from(colors: C) -> U
fn uints_from(colors: C) -> U
Cast a collection of colors into a collection of unsigned integers.
Source§impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
Source§fn uints_into(self) -> C
fn uints_into(self) -> C
Cast this collection of unsigned integers into a collection of colors.