Skip to main content

SortedSlice

Struct SortedSlice 

Source
pub struct SortedSlice<Item: Ord, S: AsRef<[Item]> + ?Sized> {
    pub marker: PhantomData<Item>,
    pub slice: S,
}
Expand description

A slice of NodeId whose values are in ascending order

§Safety

Unsafe code should not rely on this to be sorted, as safe code can build arbitrary instances

Fields§

§marker: PhantomData<Item>§slice: S

Implementations§

Source§

impl<Item: Ord, S: AsRef<[Item]>> SortedSlice<Item, S>

Source

pub fn new(slice: S) -> Self

Trait Implementations§

Source§

impl<Item: Debug + Ord, S: Debug + AsRef<[Item]> + ?Sized> Debug for SortedSlice<Item, S>

Source§

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

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

impl<Item: Ord, S: AsRef<[Item]>> Deref for SortedSlice<Item, S>

Source§

type Target = S

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<Item: Eq + Ord, S: Eq + AsRef<[Item]> + ?Sized> Eq for SortedSlice<Item, S>

Source§

impl<'a, Item: Ord, S: AsRef<[Item]>> From<&'a SortedSlice<Item, S>> for SortedSlice<Item, &'a [Item]>

Source§

fn from(v: &'a SortedSlice<Item, S>) -> Self

Converts to this type from the input type.
Source§

impl<'a, Item: Ord + Copy> IntoIterator for SortedSlice<Item, &'a [Item]>

Source§

type Item = Item

The type of the elements being iterated over.
Source§

type IntoIter = Copied<Iter<'a, Item>>

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<Item: PartialEq + Ord, S: PartialEq + AsRef<[Item]> + ?Sized> PartialEq for SortedSlice<Item, S>

Source§

fn eq(&self, other: &SortedSlice<Item, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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<S: AsRef<[NodeId]> + ?Sized> ReadNodeSet for SortedSlice<NodeId, S>

Source§

fn contains(&self, node: NodeId) -> bool

Runs in logarithmic time, as it performs a binary search

Source§

impl<Item: PartialEq + Ord, S: PartialEq + AsRef<[Item]> + ?Sized> StructuralPartialEq for SortedSlice<Item, S>

Auto Trait Implementations§

§

impl<Item, S> Freeze for SortedSlice<Item, S>
where S: Freeze + ?Sized,

§

impl<Item, S> RefUnwindSafe for SortedSlice<Item, S>
where S: RefUnwindSafe + ?Sized, Item: RefUnwindSafe,

§

impl<Item, S> Send for SortedSlice<Item, S>
where S: Send + ?Sized, Item: Send,

§

impl<Item, S> Sync for SortedSlice<Item, S>
where S: Sync + ?Sized, Item: Sync,

§

impl<Item, S> Unpin for SortedSlice<Item, S>
where S: Unpin + ?Sized, Item: Unpin,

§

impl<Item, S> UnsafeUnpin for SortedSlice<Item, S>
where S: UnsafeUnpin + ?Sized,

§

impl<Item, S> UnwindSafe for SortedSlice<Item, S>
where S: UnwindSafe + ?Sized, Item: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> CastableFrom<T> for T

Source§

fn cast_from(value: T) -> T

Call Self as W
Source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

Source§

fn cast(self) -> U

Call W::cast_from(self)
Source§

impl<T> DowncastableFrom<T> for T

Source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
Source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

Source§

fn downcast(self) -> U

Call W::downcast_from(self)
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<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<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
Source§

impl<I> IntoIteratorExt<I> for I
where I: IntoIterator,

Source§

fn into_into_lender(self) -> FromIntoIter<I>

Turn this IntoIterator into an IntoLender without allocation. Read more
Source§

impl<I> IntoIteratorExt<I> for I
where I: IntoIterator,

Source§

fn into_into_lender(self) -> FromIntoIter<I>

Turn this IntoIterator into a IntoLender without allocation. Read more
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<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Splat<T> for T

Source§

fn splat(value: T) -> T

Source§

impl<T> To<T> for T

Source§

fn to(self) -> T

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> UpcastableFrom<T> for T

Source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
Source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

Source§

fn upcast(self) -> U

Call W::upcast_from(self)
Source§

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

Source§

fn vzip(self) -> V