CacheKey

Struct CacheKey 

Source
#[repr(transparent)]
pub struct CacheKey<T>(pub T);
Expand description

A key usable in a hashmap to compare the bit representation types containing colors.

See the module level docs for more information.

Tuple Fields§

§0: T

Implementations§

Source§

impl<T> CacheKey<T>

Source

pub fn new(value: T) -> Self

Create a new CacheKey.

All fields are public, so the struct constructor can also be used.

Source

pub fn into_inner(self) -> T

Get the inner value.

Trait Implementations§

Source§

impl<T: Clone> Clone for CacheKey<T>

Source§

fn clone(&self) -> CacheKey<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> Debug for CacheKey<T>

Source§

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

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

impl<T: BitHash> Hash for CacheKey<T>

Source§

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

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: BitEq> PartialEq for CacheKey<T>

Source§

fn eq(&self, other: &Self) -> 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> TransparentWrapper<T> for CacheKey<T>

Source§

fn wrap(s: Inner) -> Self
where Self: Sized,

Convert the inner type into the wrapper type.
Source§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
Source§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
Source§

fn wrap_slice(s: &[Inner]) -> &[Self]
where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
Source§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]
where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
Source§

fn peel(s: Self) -> Inner
where Self: Sized,

Convert the wrapper type into the inner type.
Source§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
Source§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
Source§

fn peel_slice(s: &[Self]) -> &[Inner]
where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
Source§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]
where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
Source§

impl<T: Copy> Copy for CacheKey<T>

Source§

impl<T: BitEq> Eq for CacheKey<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for CacheKey<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<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> 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<I, T> TransparentWrapperAlloc<I> for T
where T: TransparentWrapper<I> + ?Sized, I: ?Sized,

Source§

fn wrap_vec(s: Vec<Inner>) -> Vec<Self>
where Self: Sized,

Convert a vec of the inner type into a vec of the wrapper type.
Source§

fn wrap_box(s: Box<Inner>) -> Box<Self>

Convert a box to the inner type into a box to the wrapper type.
Source§

fn wrap_rc(s: Rc<Inner>) -> Rc<Self>

Convert an Rc to the inner type into an Rc to the wrapper type.
Source§

fn wrap_arc(s: Arc<Inner>) -> Arc<Self>

Convert an Arc to the inner type into an Arc to the wrapper type.
Source§

fn peel_vec(s: Vec<Self>) -> Vec<Inner>
where Self: Sized,

Convert a vec of the wrapper type into a vec of the inner type.
Source§

fn peel_box(s: Box<Self>) -> Box<Inner>

Convert a box to the wrapper type into a box to the inner type.
Source§

fn peel_rc(s: Rc<Self>) -> Rc<Inner>

Convert an Rc to the wrapper type into an Rc to the inner type.
Source§

fn peel_arc(s: Arc<Self>) -> Arc<Inner>

Convert an Arc to the wrapper type into an Arc to the inner type.
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.