Skip to main content

Struct tauri::api::assets::phf::OrderedSet

pub struct OrderedSet<T> where
    T: 'static,  { /* fields omitted */ }

An order-preserving immutable set constructed at compile time.

Unlike a Set, iteration order is guaranteed to match the definition order.

Note#

The fields of this struct are public so that they may be initialized by the phf_ordered_set! macro and code generation. They are subject to change at any time and should never be accessed directly.

Implementations#

OrderedSet#

impl<T> OrderedSet<T>

Defined in: ordered_set.rs:31-87

len#

pub fn len(&self) -> usize

Returns the number of elements in the OrderedSet.

Defined in: ordered_set.rs:33

is_empty#

pub fn is_empty(&self) -> bool

Returns true if the OrderedSet contains no elements.

Defined in: ordered_set.rs:38

get_key#

pub fn get_key<U>(&self, key: &U) -> Option<&T> where
    T: PhfBorrow<U>,
    U: Eq + PhfHash + ?Sized, 

Returns a reference to the set’s internal static instance of the given key.

This can be useful for interning schemes.

Defined in: ordered_set.rs:46-49

get_index#

pub fn get_index<U>(&self, key: &U) -> Option<usize> where
    T: PhfBorrow<U>,
    U: Eq + PhfHash + ?Sized, 

Returns the index of the key within the list used to initialize the ordered set.

Defined in: ordered_set.rs:56-59

index#

pub fn index(&self, index: usize) -> Option<&T>

Returns a reference to the key at an index within the list used to initialize the ordered set. See .get_index(key).

Defined in: ordered_set.rs:66

contains#

pub fn contains<U>(&self, value: &U) -> bool where
    T: PhfBorrow<U>,
    U: Eq + PhfHash + ?Sized, 

Returns true if value is in the Set.

Defined in: ordered_set.rs:71-74

iter#

pub fn iter(&self) -> Iter<'_, T>ⓘ
Notable traits for Iter<'a, T>
impl<'a, T> Iterator for Iter<'a, T>
    type Item = &'a T;

Returns an iterator over the values in the set.

Values are returned in the same order in which they were defined.

Defined in: ordered_set.rs:82

OrderedSet#

impl<T> OrderedSet<T> where
    T: Eq + PhfHash + PhfBorrow<T>, 

Defined in: ordered_set.rs:89-110

is_disjoint#

pub fn is_disjoint(&self, other: &OrderedSet<T>) -> bool

Returns true if other shares no elements with self.

Defined in: ordered_set.rs:95

is_subset#

pub fn is_subset(&self, other: &OrderedSet<T>) -> bool

Returns true if other contains all values in self.

Defined in: ordered_set.rs:101

is_superset#

pub fn is_superset(&self, other: &OrderedSet<T>) -> bool

Returns true if self contains all values in other.

Defined in: ordered_set.rs:107

Trait Implementations#

Debug#

impl<T> Debug for OrderedSet<T> where
    T: Debug, 

Defined in: ordered_set.rs:22-29

fmt#

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

Formats the value using the given formatter. Read more

Defined in: ordered_set.rs:26

IntoIterator#

impl<'a, T> IntoIterator for &'a OrderedSet<T>

Defined in: ordered_set.rs:112-119

type Item = &'aT#

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>#

Which kind of iterator are we turning this into?

into_iter#

pub fn into_iter(self) -> Iter<'a, T>ⓘ
Notable traits for Iter<'a, T>
impl<'a, T> Iterator for Iter<'a, T>
    type Item = &'a T;

Creates an iterator from a value. Read more

Defined in: ordered_set.rs:116

Auto Trait Implementations#

impl<T> RefUnwindSafe for OrderedSet<T> where T: RefUnwindSafe,#

impl<T> Send for OrderedSet<T> where T: Send + Sync,#

impl<T> Sync for OrderedSet<T> where T: Sync,#

impl<T> Unpin for OrderedSet<T> where T: Unpin,#

impl<T> UnwindSafe for OrderedSet<T> where T: RefUnwindSafe + UnwindSafe,#

Blanket Implementations#

Any#

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

Defined in: any.rs:131-135

type_id#

pub fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more

Defined in: any.rs:132

Borrow#

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

Defined in: borrow.rs:208-213

borrow#

pub fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

Defined in: borrow.rs:210

BorrowMut#

impl<T> BorrowMut<T> for T where
    T: ?Sized, 

Defined in: borrow.rs:216-220

borrow_mut#

pub fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more

Defined in: borrow.rs:217

From#

impl<T> From<T> for T

Defined in: mod.rs:544-548

from#

pub fn from(t: T) -> T

Performs the conversion.

Defined in: mod.rs:545

Into#

impl<T, U> Into<U> for T where
    U: From<T>, 

Defined in: mod.rs:533-540

into#

pub fn into(self) -> U

Performs the conversion.

Defined in: mod.rs:537

TryFrom#

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

Defined in: mod.rs:581-590

type Error = Infallible#

The type returned in the event of a conversion error.

try_from#

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

Defined in: mod.rs:587

TryInto#

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

Defined in: mod.rs:567-576

type Error = <U as TryFrom<T>>::Error#

The type returned in the event of a conversion error.

try_into#

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Defined in: mod.rs:573

impl<V, T> VZip<V> for T where V: MultiLane<T>,#

pub fn vzip(self) -> V#