#[repr(C)]pub struct Slider {
pub slider_state: SliderStateWrapper,
pub track_style: CssPropertyWithConditionsVec,
pub thumb_style: CssPropertyWithConditionsVec,
}Expand description
A horizontal slider with a draggable thumb and a value-change callback.
Fields§
§slider_state: SliderStateWrapper§track_style: CssPropertyWithConditionsVecStyle for the slider track (the horizontal rail).
thumb_style: CssPropertyWithConditionsVecStyle for the draggable thumb.
Implementations§
Source§impl Slider
impl Slider
Sourcepub fn create(value: f32, min: f32, max: f32) -> Self
pub fn create(value: f32, min: f32, max: f32) -> Self
Creates a slider with the given current value and [min, max] range.
Sourcepub fn set_value(&mut self, value: f32)
pub fn set_value(&mut self, value: f32)
Sets the current value (clamped to the range), recomputing the thumb position.
Sourcepub fn with_value(self, value: f32) -> Self
pub fn with_value(self, value: f32) -> Self
Builder-style setter for the current value.
pub fn swap_with_default(&mut self) -> Self
pub fn set_on_value_change<C: Into<SliderOnValueChangeCallback>>( &mut self, data: RefAny, on_value_change: C, )
pub fn with_on_value_change<C: Into<SliderOnValueChangeCallback>>( self, data: RefAny, on_value_change: C, ) -> Self
pub fn dom(self) -> Dom
Trait Implementations§
impl StructuralPartialEq for Slider
Auto Trait Implementations§
impl Freeze for Slider
impl RefUnwindSafe for Slider
impl Send for Slider
impl Sync for Slider
impl Unpin for Slider
impl UnsafeUnpin for Slider
impl UnwindSafe for Slider
Blanket Implementations§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more