Struct egui::widgets::Spinner

source ·
pub struct Spinner {
    size: Option<f32>,
    color: Option<Color32>,
}
Expand description

A spinner widget used to indicate loading.

See also: crate::ProgressBar.

Fields§

§size: Option<f32>

Uses the style’s interact_size if None.

§color: Option<Color32>

Implementations§

source§

impl Spinner

source

pub fn new() -> Self

Create a new spinner that uses the style’s interact_size unless changed.

source

pub fn size(self, size: f32) -> Self

Sets the spinner’s size. The size sets both the height and width, as the spinner is always square. If the size isn’t set explicitly, the active style’s interact_size is used.

source

pub fn color(self, color: impl Into<Color32>) -> Self

Sets the spinner’s color.

source

pub fn paint_at(&self, ui: &Ui, rect: Rect)

Paint the spinner in the given rectangle.

Trait Implementations§

source§

impl Default for Spinner

source§

fn default() -> Spinner

Returns the “default value” for a type. Read more
source§

impl Widget for Spinner

source§

fn ui(self, ui: &mut Ui) -> Response

Allocate space, interact, paint, and return a Response. Read more

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.