Skip to main content

SortHeader

Struct SortHeader 

Source
pub struct SortHeader<'a> {
    pub title: &'a str,
    pub name: &'a str,
    pub descending: Option<bool>,
    pub sortable: bool,
}
Expand description

A column’s header: its box is the kit’s table-header-cell component, selected while the rows are sorted by it, the direction the kit’s sort-ascending or sort-descending glyph after the title. A button for assistive technology, a label when it does not sort. The data table’s and the file picker’s.

Need (data): a sortable column header.

Fields§

§title: &'a str

What it shows.

§name: &'a str

Its name for assistive technology, which says the direction.

§descending: Option<bool>

Whether the rows are sorted by it, and whether downwards.

§sortable: bool

Whether a click sorts.

Implementations§

Source§

impl SortHeader<'_>

Source

pub fn show(self, ui: &Ui, kit: &Kit, rect: Rect, id: Id) -> Response

Draws it over rect. The caller decides what a click does.

Source

pub fn show_icon( self, ui: &Ui, kit: &Kit, rect: Rect, id: Id, icon: Icon, ) -> Response

Draws it over rect with icon in its title’s place (a narrow column’s header): the title is no longer shown but stays its name for assistive technology, and the sort glyph follows the icon. The caller gives the icon’s tooltip (Response::on_hover_text).

Need (data): a narrow column’s header shown as an icon.

Trait Implementations§

Source§

impl<'a> Clone for SortHeader<'a>

Source§

fn clone(&self) -> SortHeader<'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 SortHeader<'a>

Source§

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

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

impl<'a> Copy for SortHeader<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for SortHeader<'a>

§

impl<'a> RefUnwindSafe for SortHeader<'a>

§

impl<'a> Send for SortHeader<'a>

§

impl<'a> Sync for SortHeader<'a>

§

impl<'a> Unpin for SortHeader<'a>

§

impl<'a> UnsafeUnpin for SortHeader<'a>

§

impl<'a> UnwindSafe for SortHeader<'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> 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> 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> 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
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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, 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,