pub struct UseSorterBuilder<F> { /* private fields */ }
Expand description

Builder for UseSorter. Use this to specify the field and direction of the sorter. For example by passing sort state from URL parameters.

Ordering of Self::with_field and Self::with_direction matters as the builder will ignore invalid combinations specified by the field’s Sortable. This is to prevent the user from specifying a direction that is not allowed by the field.

Implementations§

source§

impl<F: Copy + Default + Sortable> UseSorterBuilder<F>

source

pub fn with_field(&self, field: F) -> Self

Optionally sets the initial field to sort by.

source

pub fn with_direction(&self, direction: Direction) -> Self

Optionally sets the initial direction to sort by.Direction::Ascending can be set.

source

pub fn use_sorter(self, cx: &ScopeState) -> UseSorter<'_, F>

Creates Dioxus hooks to manage state. Must follow Dioxus hook rules and be called unconditionally in the same order as other hooks. See use_sorter() for simple usage.

This fn (or Self::use_sorter) must be called or never used. See the docs on UseSorter::sort on using conditions.

If the field or direction has not been set then the default values will be used.

Trait Implementations§

source§

impl<F: Clone> Clone for UseSorterBuilder<F>

source§

fn clone(&self) -> UseSorterBuilder<F>

Returns a copy 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<F: Debug> Debug for UseSorterBuilder<F>

source§

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

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

impl<F: Default + Sortable> Default for UseSorterBuilder<F>

source§

fn default() -> Self

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

impl<F: PartialEq> PartialEq<UseSorterBuilder<F>> for UseSorterBuilder<F>

source§

fn eq(&self, other: &UseSorterBuilder<F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: Copy> Copy for UseSorterBuilder<F>

source§

impl<F> StructuralPartialEq for UseSorterBuilder<F>

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for UseSorterBuilder<F>where F: RefUnwindSafe,

§

impl<F> Send for UseSorterBuilder<F>where F: Send,

§

impl<F> Sync for UseSorterBuilder<F>where F: Sync,

§

impl<F> Unpin for UseSorterBuilder<F>where F: Unpin,

§

impl<F> UnwindSafe for UseSorterBuilder<F>where F: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> To for Twhere T: ?Sized,

§

fn to<T>(self) -> Twhere Self: Into<T>,

Converts to T by calling Into<T>::into.
§

fn try_to<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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> Dep for Twhere T: 'static + PartialEq<T> + Clone,