Skip to main content

NonEmptyStack

Struct NonEmptyStack 

Source
pub struct NonEmptyStack<T> { /* private fields */ }
Expand description

A stack that ALWAYS have at least one element.

Implementations§

Source§

impl<T> NonEmptyStack<T>

A stack that always have at least one element, where the last element can be frequently accessed

Source

pub const fn new(value: T) -> NonEmptyStack<T>

Source

pub fn with_capacity(value: T, capacity: usize) -> NonEmptyStack<T>

Source

pub fn from_vec(stack: Vec<T>) -> Option<NonEmptyStack<T>>

Source

pub fn len(&self) -> usize

Source

pub const fn last(&self) -> &T

Source

pub const fn last_mut(&mut self) -> &mut T

Source

pub fn clear_and_keep_last(&mut self)

Clear the stack and keep the last element

use hexga_utils::prelude::*;

let mut stack = NonEmptyStack::from_vec(vec![1,2,3,4]).unwrap();
stack.clear_and_keep_last();
assert_eq!(stack.len(), 1);
assert_eq!(stack.last(), &4);
Source

pub fn clear_and_keep_first(&mut self)

Clear the stack and keep the first element

use hexga_utils::prelude::*;

let mut stack = NonEmptyStack::from_vec(vec![1,2,3,4]).unwrap();
stack.clear_and_keep_first();
assert_eq!(stack.len(), 1);
assert_eq!(stack.last(), &1);
Source

pub fn clear_and_keep(&mut self, value: T)

Clear the stack and keep passed value

Source

pub fn clear(&mut self)
where T: Default,

Clear the stack and keep defaut value

Source

pub fn replace(&mut self, value: T) -> T

Replace the last value

Source

pub fn push(&mut self, value: T)

Source

pub fn duplicate(&mut self) -> &mut NonEmptyStack<T>
where T: Clone,

Clone the last element and push it

Source

pub fn pop(&mut self) -> Option<T>

Source

pub fn iter(&self) -> NonEmptyStackIter<'_, T>

Source

pub fn iter_mut(&mut self) -> NonEmptyStackIterMut<'_, T>

Source

pub fn into_values(self) -> Vec<T>

Trait Implementations§

Source§

impl<T> Capacity for NonEmptyStack<T>

Source§

fn capacity(&self) -> usize

Source§

impl<T> Clone for NonEmptyStack<T>
where T: Clone,

Source§

fn clone(&self) -> NonEmptyStack<T>

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<T> Debug for NonEmptyStack<T>
where T: Debug,

Source§

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

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

impl<T> Default for NonEmptyStack<T>
where T: Default,

Source§

fn default() -> NonEmptyStack<T>

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

impl<T> Deref for NonEmptyStack<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<NonEmptyStack<T> as Deref>::Target

Dereferences the value.
Source§

impl<T> DerefMut for NonEmptyStack<T>

Source§

fn deref_mut(&mut self) -> &mut <NonEmptyStack<T> as Deref>::Target

Mutably dereferences the value.
Source§

impl<'de, T> Deserialize<'de> for NonEmptyStack<T>
where T: Deserialize<'de>,

Available on crate feature serde only.
Source§

fn deserialize<D>( deserializer: D, ) -> Result<NonEmptyStack<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> Get<usize> for NonEmptyStack<T>

Source§

type Output = T

Source§

fn get(&self, index: usize) -> Option<&<NonEmptyStack<T> as Get<usize>>::Output>

Returns a reference to the value.
Source§

unsafe fn get_unchecked( &self, index: usize, ) -> &<NonEmptyStack<T> as Get<usize>>::Output

Returns a reference to the value.
Source§

fn get_or_panic(&self, index: Idx) -> &Self::Output

Returns a reference to the value.
Source§

fn is_index_valid(&self, index: Idx) -> bool

True if get(index) return Some, false otherwise.
Source§

fn is_index_invalid(&self, index: Idx) -> bool

True if get(index) return None, false otherwise.
Source§

fn contains(&self, index: Idx) -> bool

Source§

impl<T> GetManyMut<usize> for NonEmptyStack<T>

Source§

fn try_get_many_mut<const N: usize>( &mut self, indices: [usize; N], ) -> Result<[&mut <NonEmptyStack<T> as Get<usize>>::Output; N], GetDisjointMutError>

Source§

fn get_many_mut<const N: usize>( &mut self, indices: [Idx; N], ) -> Option<[&mut Self::Output; N]>

Returns multiples mutables references to the values. All values that can be accessed with the indices must be disjoint.
Source§

fn get_many_mut_or_panic<const N: usize>( &mut self, indices: [Idx; N], ) -> [&mut Self::Output; N]

Returns multiples mutables references to the values. All values that can be accessed with the indices must be disjoint.
Source§

unsafe fn get_many_unchecked_mut<const N: usize>( &mut self, indices: [Idx; N], ) -> [&mut Self::Output; N]

Returns multiples mutables references to the values. All values that can be accessed with the indices must be disjoint.
Source§

fn swap(&mut self, a: Idx, b: Idx) -> bool
where Self::Output: Sized,

Swaps the values at two mutable locations, without deinitializing either one. Read more
Source§

fn swap_or_panic(&mut self, a: Idx, b: Idx)
where Self::Output: Sized,

Swaps the values at two mutable locations, without deinitializing either one. Read more
Source§

unsafe fn swap_unchecked(&mut self, a: Idx, b: Idx)
where Self::Output: Sized,

Swaps the values at two mutable locations, without deinitializing either one. Read more
Source§

impl<T> GetMut<usize> for NonEmptyStack<T>

Source§

fn get_mut( &mut self, index: usize, ) -> Option<&mut <NonEmptyStack<T> as Get<usize>>::Output>

Returns a mutable reference to the value.
Source§

unsafe fn get_unchecked_mut( &mut self, index: usize, ) -> &mut <NonEmptyStack<T> as Get<usize>>::Output

Returns a mutable reference to the value.
Source§

fn get_mut_or_panic(&mut self, index: Idx) -> &mut Self::Output

Source§

fn replace(&mut self, index: Idx, value: Self::Output) -> Option<Self::Output>
where Self::Output: Sized,

Replace the value and return the old one. Read more
Source§

fn replace_or_panic(&mut self, index: Idx, value: Self::Output) -> Self::Output
where Self::Output: Sized,

Replace the value and return the old one. Read more
Source§

unsafe fn replace_unchecked( &mut self, index: Idx, value: Self::Output, ) -> Self::Output
where Self::Output: Sized,

Replace the value and return the old one. Read more
Source§

fn set(&mut self, index: Idx, value: Self::Output) -> bool
where Self::Output: Sized,

Set the value and drop the previous one.
Source§

fn set_or_panic(&mut self, index: Idx, value: Self::Output) -> &mut Self
where Self::Output: Sized,

Set the value and drop the previous one.
Source§

unsafe fn set_unchecked(&mut self, index: Idx, value: Self::Output) -> &mut Self
where Self::Output: Sized,

Source§

impl<T> Hash for NonEmptyStack<T>
where T: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> Index<usize> for NonEmptyStack<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &<NonEmptyStack<T> as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T> IndexMut<usize> for NonEmptyStack<T>

Source§

fn index_mut( &mut self, index: usize, ) -> &mut <NonEmptyStack<T> as Index<usize>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

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

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = NonEmptyStackIter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a NonEmptyStack<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for &'a mut NonEmptyStack<T>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = NonEmptyStackIterMut<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a mut NonEmptyStack<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> IntoIterator for NonEmptyStack<T>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = NonEmptyStackIntoIter<T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <NonEmptyStack<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> Length for NonEmptyStack<T>

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

True if the container contains 0 elements. Read more
Source§

fn is_not_empty(&self) -> bool

True if the container contains at least one element. Will always be different than is_empty(). Read more
Source§

impl<T> Ord for NonEmptyStack<T>
where T: Ord,

Source§

fn cmp(&self, other: &NonEmptyStack<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T> PartialEq for NonEmptyStack<T>
where T: PartialEq,

Source§

fn eq(&self, other: &NonEmptyStack<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for NonEmptyStack<T>
where T: PartialOrd,

Source§

fn partial_cmp(&self, other: &NonEmptyStack<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Reserve for NonEmptyStack<T>

Source§

fn reserve(&mut self, additional: usize)

Source§

fn reserve_exact(&mut self, additional: usize)

Source§

fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Source§

fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>

Source§

fn reserve_total(&mut self, total: usize)
where Self: Length,

Ensure total capacity is at least total. Does nothing if the current capacity is already >= total.
Source§

fn try_reserve_total(&mut self, total: usize) -> Result<(), TryReserveError>
where Self: Length,

Ensure total capacity is at least total. Does nothing if the current capacity is already >= total.
Source§

fn reserve_total_exact(&mut self, total: usize)
where Self: Length,

Ensure total capacity is at least total. Does nothing if the current capacity is already >= total.
Source§

fn try_reserve_total_exact( &mut self, total: usize, ) -> Result<(), TryReserveError>
where Self: Length,

Ensure total capacity is at least total. Does nothing if the current capacity is already >= total.
Source§

impl<T> Serialize for NonEmptyStack<T>
where T: Serialize,

Available on crate feature serde only.
Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> Shrink for NonEmptyStack<T>

Source§

fn shrink_to_fit(&mut self)

Shrinks the capacity as much as possible.
Source§

fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity with a lower bound. The capacity will remain at least as large as both the length and the supplied value. If the current capacity is less than the lower limit, this is a no-op.
Source§

impl<T> Truncate for NonEmptyStack<T>

Source§

fn truncate(&mut self, len: usize)

Shortens it, keeping the first len elements and dropping the rest. Read more
Source§

impl<T> TryFrom<Vec<T>> for NonEmptyStack<T>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from( value: Vec<T>, ) -> Result<NonEmptyStack<T>, <NonEmptyStack<T> as TryFrom<Vec<T>>>::Error>

Performs the conversion.
Source§

impl<T> WithCapacity for NonEmptyStack<T>

Source§

type Param = T

Source§

fn with_capacity_and_param( capacity: usize, value: <NonEmptyStack<T> as WithCapacity>::Param, ) -> NonEmptyStack<T>

Source§

fn with_capacity(capacity: usize) -> Self
where Self: Sized, Self::Param: Default,

Source§

impl<T> Collection for NonEmptyStack<T>

Source§

impl<T> CollectionBijective for NonEmptyStack<T>

Source§

impl<T> Eq for NonEmptyStack<T>
where T: Eq,

Source§

impl<T> StructuralPartialEq for NonEmptyStack<T>

Auto Trait Implementations§

§

impl<T> Freeze for NonEmptyStack<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for NonEmptyStack<T>
where T: RefUnwindSafe,

§

impl<T> Send for NonEmptyStack<T>
where T: Send,

§

impl<T> Sync for NonEmptyStack<T>
where T: Sync,

§

impl<T> Unpin for NonEmptyStack<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for NonEmptyStack<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for NonEmptyStack<T>
where T: UnwindSafe,

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<S, T> CastInto<T> for S
where T: CastFrom<S>,

Source§

fn cast_into(self) -> T

Source§

impl<S, T> CastRangeInto<T> for S
where T: CastRangeFrom<S>,

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<I, T> CollectTo<T> for I
where I: IntoIterator<Item = T>,

Source§

fn to_vec(self) -> Vec<T>

Source§

fn to_linkedlist(self) -> LinkedList<T>

Source§

fn to_vecdeque(self) -> VecDeque<T>

Source§

fn to_hashset(self) -> HashSet<T>
where T: Eq + Hash,

Source§

fn to_btreeset(self) -> BTreeSet<T>
where T: Ord,

Source§

impl<I, K, V, S> CollectToGenMap<K, V, S> for I
where I: IntoIterator<Item = (K, V)>, K: Clone,

Source§

fn to_genmap(self) -> GenMapOf<K, V, u32, S>
where GenMapOf<K, V, u32, S>: WithCapacity + Reserve, <GenMapOf<K, V, u32, S> as WithCapacity>::Param: Default, S: Default + Insert<K, GenIDOf<V>>,

Source§

impl<I, K, S> CollectToGenSet<K, S> for I
where I: IntoIterator<Item = K>, K: Clone,

Source§

fn to_genset(self) -> GenSetOf<K, u32, S>
where GenSetOf<K, u32, S>: WithCapacity + Reserve, <GenSetOf<K, u32, S> as WithCapacity>::Param: Default, S: Default + Insert<K, GenIDOf<K>> + for<'a> Remove<&'a K, Output = GenIDOf<K>>,

Source§

impl<I, T> CollectToGenVec<T> for I
where I: IntoIterator<Item = T>,

Source§

fn to_genvec(self) -> GenSeq<T>

Source§

impl<I, T1, T2> CollectToMap<T1, T2> for I
where I: IntoIterator<Item = (T1, T2)>,

Source§

fn to_hashmap(self) -> HashMap<T1, T2>
where T1: Eq + Hash,

Source§

fn to_btreemap(self) -> BTreeMap<T1, T2>
where T1: Ord,

Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DefaultExtension for T
where T: Default + PartialEq,

Source§

impl<T> DefaultIsTripleUnderscore for T
where T: Default,

Source§

fn ___() -> T

The Self::default() method. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromJson for T
where T: for<'de> Deserialize<'de>,

Source§

fn from_json_bytes(bytes: &[u8]) -> Result<Self, EncodeError>

Source§

fn from_json_with_reader<R>(reader: R) -> Result<Self, EncodeError>
where R: Read,

Source§

fn from_json(json: &str) -> Result<Self, EncodeError>

Source§

impl<T> FromRon for T
where T: for<'de> Deserialize<'de>,

Source§

fn from_ron_bytes(bytes: &[u8]) -> Result<Self, EncodeError>

Source§

fn from_ron_with_reader<R>(reader: R) -> Result<Self, EncodeError>
where R: Read,

Source§

fn from_ron(ron: &str) -> Result<Self, EncodeError>

Source§

impl<T> FromTmpBin for T
where T: for<'de> Deserialize<'de>,

Source§

fn from_tmp_bin_bytes(bytes: &[u8]) -> Result<Self, EncodeError>

Source§

fn from_tmp_bin_with_reader<R>(reader: R) -> Result<Self, EncodeError>
where R: Read,

Source§

impl<T> FromXml for T
where T: for<'de> Deserialize<'de>,

Source§

fn from_xml_bytes(bytes: &[u8]) -> Result<Self, EncodeError>

Source§

fn from_xml_with_reader<R>(reader: R) -> Result<Self, EncodeError>
where R: Read,

Source§

fn from_xml(xml: &str) -> Result<Self, EncodeError>

Source§

impl<T> HasMut<T> for T

Source§

fn retrive_mut(&mut self) -> &mut T

Source§

impl<T> HasRef<T> for T

Source§

fn retrive_ref(&self) -> &T

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
Source§

impl<'a, Item, T> IterExtension<'a, Item> for T
where &'a T: IntoIterator<Item = Item> + 'a,

Source§

fn iter(&'a self) -> <&'a Self as IntoIterator>::IntoIter

Source§

impl<Item, T> IterPredicate<Item> for T
where T: IntoIterator<Item = Item>,

Source§

fn any<P>(self, p: P) -> bool
where P: FnMut(Item) -> bool,

Source§

fn all<P>(self, p: P) -> bool
where P: FnMut(Item) -> bool,

Source§

fn any_with<P, O>(self, other: O, p: P) -> bool
where P: FnMut(Item, Item) -> bool, O: IntoIterator<Item = Item>,

Source§

fn all_with<P, O>(self, other: O, p: P) -> bool
where P: FnMut(Item, Item) -> bool, O: IntoIterator<Item = Item>,

Source§

impl<T, Z> MinusOneIter for T
where &'a T: for<'a> IntoIterator<Item = &'a Z>, Z: MinusOne + PartialEq,

Source§

impl<T, Z> OneIter for T
where &'a T: for<'a> IntoIterator<Item = &'a Z>, Z: One + PartialEq,

Source§

fn all_one(&self) -> bool

Source§

fn any_one(&self) -> bool

Source§

impl<T> PartialOrdExtension for T
where T: PartialOrd,

Source§

fn max_partial(self, other: Self) -> Self
where Self: Sized,

Using PartialOrd operator, not component wise
Source§

fn min_partial(self, other: Self) -> Self
where Self: Sized,

Using PartialOrd operator, not component wise
Source§

fn clamp_partial(self, min: Self, max: Self) -> Self
where Self: Sized,

Using PartialOrd operator, not component wise
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

impl<T> ToJson for T
where T: Serialize,

Source§

fn to_json(&self) -> Result<String, EncodeError>

Source§

fn to_json_with_writer<W>(&self, writer: W) -> Result<(), EncodeError>
where W: Write,

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> ToRon for T
where T: Serialize,

Source§

fn to_ron(&self) -> Result<String, EncodeError>

Source§

fn to_ron_with_writer<W>(&self, writer: W) -> Result<(), EncodeError>
where W: Write,

Source§

impl<T> ToTmpBin for T
where T: Serialize,

Source§

fn to_tmp_bin(&self) -> Result<Vec<u8>, EncodeError>

Intended for short-term storage of data in a binary format, such as during data transfer. Read more
Source§

fn to_tmp_bin_with_writer<W>(&self, writer: W) -> Result<(), EncodeError>
where W: Write,

Intended for short-term storage of data in a binary format, such as during data transfer. Read more
Source§

impl<T> ToXml for T
where T: Serialize,

Source§

fn to_xml(&self) -> Result<String, EncodeError>

Source§

fn to_xml_with_writer<W>(&self, writer: W) -> Result<(), EncodeError>
where W: Write,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T, Z> ZeroIter for T
where &'a T: for<'a> IntoIterator<Item = &'a Z>, Z: Zero + PartialEq,

Source§

impl<T> Async for T
where T: Send + Sync + 'static,

Source§

impl<T> AsyncDebug for T
where T: Async + Debug,

Source§

impl<'de, T> CfgDeserialize<'de> for T
where T: Deserialize<'de> + ?Sized,

Source§

impl<T> CfgSerialize for T
where T: Serialize + ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,