Skip to main content

RichSpan

Struct RichSpan 

Source
pub struct RichSpan<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> RichSpan<'a>

Source

pub fn color(self, color: AlphaColor<Srgb>) -> RichSpan<'a>

Source

pub fn family(self, family: &'a [FamilyOwned]) -> RichSpan<'a>

Source

pub fn font_width(self, stretch: FontWidth) -> RichSpan<'a>

Source

pub fn text_style(self, style: FontStyle) -> RichSpan<'a>

Source

pub fn weight(self, weight: FontWeight) -> RichSpan<'a>

Source

pub fn line_height(self, line_height: LineHeightValue) -> RichSpan<'a>

Source

pub fn font_size(self, font_size: f32) -> RichSpan<'a>

Source

pub fn raw_weight(self, weight: u16) -> RichSpan<'a>

Trait Implementations§

Source§

impl<'a> Add<&'a str> for RichSpan<'a>

Source§

type Output = RichSpanOwned

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'a str) -> <RichSpan<'a> as Add<&'a str>>::Output

Performs the + operation. Read more
Source§

impl<'a, S> Add<S> for RichSpan<'a>
where RichSpan<'a>: From<S>,

Source§

type Output = RichSpanOwned

The resulting type after applying the + operator.
Source§

fn add(self, rhs: S) -> <RichSpan<'a> as Add<S>>::Output

Performs the + operation. Read more
Source§

impl Add<String> for RichSpan<'_>

Source§

type Output = RichSpanOwned

The resulting type after applying the + operator.
Source§

fn add(self, rhs: String) -> <RichSpan<'_> as Add<String>>::Output

Performs the + operation. Read more
Source§

impl<'a> Clone for RichSpan<'a>

Source§

fn clone(&self) -> RichSpan<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for RichSpan<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, S> From<&'a S> for RichSpan<'a>
where S: AsRef<str> + 'a,

Source§

fn from(value: &'a S) -> RichSpan<'a>

Converts to this type from the input type.
Source§

impl<'a> IntoView for RichSpan<'a>

Source§

type V = RichText

The final View type this converts to.
Source§

type Intermediate = RichText

Intermediate type that has a ViewId before full view construction. Read more
Source§

fn into_intermediate(self) -> <RichSpan<'a> as IntoView>::Intermediate

Converts to the intermediate form which has a ViewId. Read more
Source§

fn into_view(self) -> Self::V

Converts the value into a View.
Source§

fn into_any(self) -> Box<dyn View>

Converts the value into a AnyView.
Source§

impl<'a> RichTextExt<'a> for RichSpan<'a>

Source§

fn color(self, color: AlphaColor<Srgb>) -> RichSpan<'a>

Source§

fn red(self) -> RichSpan<'a>

Source§

fn blue(self) -> RichSpan<'a>

Source§

fn green(self) -> RichSpan<'a>

Source§

fn yellow(self) -> RichSpan<'a>

Source§

fn black(self) -> RichSpan<'a>

Source§

fn white(self) -> RichSpan<'a>

Source§

fn gray(self) -> RichSpan<'a>

Source§

fn cyan(self) -> RichSpan<'a>

Source§

fn magenta(self) -> RichSpan<'a>

Source§

fn orange(self) -> RichSpan<'a>

Source§

fn purple(self) -> RichSpan<'a>

Source§

fn pink(self) -> RichSpan<'a>

Source§

fn family(self, family: &'a [FamilyOwned]) -> RichSpan<'a>

Source§

fn stretch(self, stretch: FontWidth) -> RichSpan<'a>

Source§

fn text_style(self, style: FontStyle) -> RichSpan<'a>

Source§

fn italic(self) -> RichSpan<'a>

Source§

fn oblique(self) -> RichSpan<'a>

Source§

fn weight(self, weight: FontWeight) -> RichSpan<'a>

Source§

fn thin(self) -> RichSpan<'a>

Source§

fn extra_light(self) -> RichSpan<'a>

Source§

fn light(self) -> RichSpan<'a>

Source§

fn medium(self) -> RichSpan<'a>

Source§

fn semibold(self) -> RichSpan<'a>

Source§

fn bold(self) -> RichSpan<'a>

Source§

fn extra_bold(self) -> RichSpan<'a>

Source§

fn raw_weight(self, weight: u16) -> RichSpan<'a>

Source§

fn font_size(self, font_size: f32) -> RichSpan<'a>

Source§

fn line_height(self, line_height: LineHeightValue) -> RichSpan<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RichSpan<'a>

§

impl<'a> RefUnwindSafe for RichSpan<'a>

§

impl<'a> Send for RichSpan<'a>

§

impl<'a> Sync for RichSpan<'a>

§

impl<'a> Unpin for RichSpan<'a>

§

impl<'a> UnsafeUnpin for RichSpan<'a>

§

impl<'a> UnwindSafe for RichSpan<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ButtonExt for T
where T: IntoView + 'static,

Source§

fn button(self) -> Button

Create a Button from the parent.
Source§

impl<T> ClipExt for T
where T: IntoView + 'static,

Source§

fn clip(self) -> Clip

Wrap the view in a clip view.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ContainerExt for T
where T: IntoView + 'static,

Source§

fn container(self) -> Container

Wrap the view in a container.
Source§

impl<T> Decorators for T
where T: IntoView,

Source§

fn style(self, style: impl Fn(Style) -> Style + 'static) -> Self::Intermediate

Alter the style of the view. Read more
Source§

fn debug_name(self, name: impl Into<String>) -> Self::Intermediate

Add a debug name to the view that will be shown in the inspector. Read more
Source§

fn debug_name_if<S>( self, apply: impl Fn() -> bool + 'static, name: impl Fn() -> S + 'static, ) -> Self::Intermediate
where S: Into<String>,

Conditionally add a debug name to the view that will be shown in the inspector. Read more
Source§

fn dragging_style( self, style: impl Fn(Style) -> Style + 'static, ) -> Self::Intermediate

The visual style to apply when the view is being dragged
Source§

fn class<C>(self, _class: C) -> Self::Intermediate
where C: StyleClass,

Add a style class to the view
Source§

fn class_if<C>( self, apply: impl Fn() -> bool + 'static, _class: C, ) -> Self::Intermediate
where C: StyleClass,

Conditionally add a style class to the view
Source§

fn remove_class<C>(self, _class: C) -> Self::Intermediate
where C: StyleClass,

Remove a style class from the view
Source§

fn keyboard_navigable(self) -> Self::Intermediate

👎Deprecated:

Set this property using Style::keyboard_navigable instead

Allows the element to be navigated to with the keyboard. Similar to setting tabindex=“0” in html.
Source§

fn disable_default_event<L>( self, disable: impl Fn() -> (L, bool) + 'static, ) -> Self::Intermediate

Dynamically controls whether the default view behavior for an event should be disabled. When disable is true, children will still see the event, but the view event function will not be called nor the event listeners on the view. Read more
Source§

fn draggable(self) -> <Self::Intermediate as IntoView>::Intermediate

Mark the current view as draggable with default configuration. Read more
Source§

fn draggable_with_config( self, config: impl Fn() -> DragConfig + 'static, ) -> <Self::Intermediate as IntoView>::Intermediate

Mark the current view as draggable with custom configuration. Read more
Source§

fn disabled( self, disabled_fn: impl Fn() -> bool + 'static, ) -> Self::Intermediate

👎Deprecated:

use Style::set_disabled directly instead

Mark the view as disabled Read more
Source§

fn on_event_with_config<L>( self, listener: L, config: EventCallbackConfig, action: impl FnMut(&mut EventCx<'_>, &<L as EventListenerTrait>::EventData) -> EventPropagation + 'static, ) -> Self::Intermediate

Add an event handler for the given EventListener with custom phase configuration.
Source§

fn on_event_cont_with_config<L>( self, listener: L, config: EventCallbackConfig, action: impl FnMut(&mut EventCx<'_>, &<L as EventListenerTrait>::EventData) + 'static, ) -> Self::Intermediate

Add an event handler for the given EventListener. This event will be handled with the given handler and the event will continue propagating.
Source§

fn on_event_stop_with_config<L>( self, listener: L, config: EventCallbackConfig, action: impl FnMut(&mut EventCx<'_>, &<L as EventListenerTrait>::EventData) + 'static, ) -> Self::Intermediate

Add an event handler for the given EventListener. This event will be handled with the given handler and the event will stop propagating.
Source§

fn on_event<L>( self, listener: L, action: impl FnMut(&mut EventCx<'_>, &<L as EventListenerTrait>::EventData) -> EventPropagation + 'static, ) -> Self::Intermediate

Add an event handler for the given EventListener.
Source§

fn on_event_cont<L>( self, listener: L, action: impl FnMut(&mut EventCx<'_>, &<L as EventListenerTrait>::EventData) + 'static, ) -> Self::Intermediate

Add an event handler for the given EventListener. This event will be handled with the given handler and the event will continue propagating.
Source§

fn on_event_stop<L>( self, listener: L, action: impl FnMut(&mut EventCx<'_>, &<L as EventListenerTrait>::EventData) + 'static, ) -> Self::Intermediate

Add an event handler for the given EventListener. This event will be handled with the given handler and the event will stop propagating.
Source§

fn on_key_down( self, key: Key, cmp: impl Fn(Modifiers) -> bool + 'static, action: impl FnMut(&mut EventCx<'_>, &KeyboardEvent) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event(listener::KeyDown, ...) instead.

Add a handler for pressing down a specific key.
Source§

fn on_key_up( self, key: Key, cmp: impl Fn(Modifiers) -> bool + 'static, action: impl FnMut(&mut EventCx<'_>, &KeyboardEvent) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event(listener::KeyUp, ...) instead.

Add a handler for a specific key being released.
Source§

fn on_click( self, action: impl FnMut(&mut EventCx<'_>) -> EventPropagation + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event(Click, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::Click.
Source§

fn on_click_cont( self, action: impl FnMut(&mut EventCx<'_>) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event_cont(Click, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::Click. This event will be handled with the given handler and the event will continue propagating.
Source§

fn on_click_stop( self, action: impl FnMut(&mut EventCx<'_>) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event_stop(Click, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::Click. This event will be handled with the given handler and the event will stop propagating.
Source§

fn action(self, action: impl FnMut() + 'static) -> Self::Intermediate

Attach action executed on button click or Enter or Space Key.
Source§

fn on_double_click( self, action: impl FnMut(&mut EventCx<'_>) -> EventPropagation + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event(DoubleClick, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::DoubleClick
Source§

fn on_double_click_cont( self, action: impl FnMut(&mut EventCx<'_>) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event_cont(DoubleClick, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::DoubleClick. This event will be handled with the given handler and the event will continue propagating.
Source§

fn on_double_click_stop( self, action: impl FnMut(&mut EventCx<'_>) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event_stop(DoubleClick, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::DoubleClick. This event will be handled with the given handler and the event will stop propagating.
Source§

fn on_secondary_click( self, action: impl FnMut(&mut EventCx<'_>) -> EventPropagation + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event(SecondaryClick, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::SecondaryClick. This is most often the “Right” click.
Source§

fn on_secondary_click_cont( self, action: impl FnMut(&mut EventCx<'_>) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event_cont(SecondaryClick, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::SecondaryClick. This is most often the “Right” click. This event will be handled with the given handler and the event will continue propagating.
Source§

fn on_secondary_click_stop( self, action: impl FnMut(&mut EventCx<'_>) + 'static, ) -> Self::Intermediate

👎Deprecated:

Use on_event_stop(SecondaryClick, |cx, _event| { ... }) instead. The new API provides direct access to typed event data.

Add an event handler for EventListener::SecondaryClick. This is most often the “Right” click. This event will be handled with the given handler and the event will stop propagating.
Source§

fn on_cleanup(self, action: impl Fn() + 'static) -> Self::Intermediate

Adds an event handler for cleanup events for this view. Read more
Source§

fn animation( self, animation: impl Fn(Animation) -> Animation + 'static, ) -> Self::Intermediate

Add an animation to the view. Read more
Source§

fn clear_focus(self, when: impl Fn() + 'static) -> Self::Intermediate

Clear the focus from the window. Read more
Source§

fn request_focus(self, when: impl Fn() + 'static) -> Self::Intermediate

Request that this view gets the focus for the window. Read more
Source§

fn window_scale( self, scale_fn: impl Fn() -> f64 + 'static, ) -> Self::Intermediate

Set the window scale factor. Read more
Source§

fn window_title( self, title_fn: impl Fn() -> String + 'static, ) -> Self::Intermediate

Set the window title. Read more
Source§

fn window_menu( self, menu_fn: impl Fn() -> MenuBuilder<Menu> + 'static, ) -> Self::Intermediate

Set the system window menu Read more
Source§

fn context_menu( self, menu: impl Fn() -> MenuBuilder<Menu> + 'static, ) -> Self::Intermediate

Adds a secondary-click context menu to the view, which opens at the mouse position. Read more
Source§

fn popout_menu( self, menu: impl Fn() -> MenuBuilder<Menu> + 'static, ) -> Self::Intermediate

Adds a primary-click context menu, which opens below the view. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> OverlayExt for T
where T: IntoView + 'static,

Source§

fn overlay(self) -> Overlay

Wrap the view in an overlay.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ScrollExt for T
where T: IntoView + 'static,

Source§

fn scroll(self) -> Scroll

Wrap the view in a scroll view.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TooltipExt for T
where T: IntoView + 'static,

Source§

fn tooltip<V>(self, tip: impl Fn() -> V + 'static) -> Tooltip
where V: IntoView + 'static,

Adds a tooltip to the view. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,

§

impl<T> WasmNotSync for T
where T: Sync,