#[repr(C)]pub struct Segmented {
pub segmented_state: SegmentedStateWrapper,
pub labels: StringVec,
pub container_style: CssPropertyWithConditionsVec,
}Expand description
A joined row of mutually-exclusive segments with a selection callback.
Fields§
§segmented_state: SegmentedStateWrapper§labels: StringVecThe label of each segment, in order.
container_style: CssPropertyWithConditionsVecStyle for the row container.
Implementations§
Source§impl Segmented
impl Segmented
Sourcepub fn create(labels: StringVec) -> Self
pub fn create(labels: StringVec) -> Self
Creates a segmented control from the given labels, with the first segment selected.
Sourcepub const fn set_selected_index(&mut self, selected_index: usize)
pub const fn set_selected_index(&mut self, selected_index: usize)
Sets the currently selected segment index.
Sourcepub const fn with_selected_index(self, selected_index: usize) -> Self
pub const fn with_selected_index(self, selected_index: usize) -> Self
Builder-style setter for the selected segment index.
pub fn swap_with_default(&mut self) -> Self
pub fn set_on_change<C: Into<SegmentedOnChangeCallback>>( &mut self, data: RefAny, on_change: C, )
pub fn with_on_change<C: Into<SegmentedOnChangeCallback>>( self, data: RefAny, on_change: C, ) -> Self
pub fn dom(self) -> Dom
Trait Implementations§
impl Eq for Segmented
impl StructuralPartialEq for Segmented
Auto Trait Implementations§
impl Freeze for Segmented
impl RefUnwindSafe for Segmented
impl Send for Segmented
impl Sync for Segmented
impl Unpin for Segmented
impl UnsafeUnpin for Segmented
impl UnwindSafe for Segmented
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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