pub struct Key(/* private fields */);
Expand description
Key is a dynamically typed wrapper around any type that implements `Any + Eq
- Hash
(note that
Anyimplies
’static). Key acts as a transparent wrapper for these traits, where
Eqand
PartialEq` in particular perform dynamic type checks before determining value equality.
Implementations§
Source§impl Key
impl Key
Sourcepub fn new<T>(value: T) -> Keywhere
T: Keyable + 'static,
pub fn new<T>(value: T) -> Keywhere
T: Keyable + 'static,
This function returns a new key with the given value. The prescribed
trait bound on machinery::Keyable
refers to a hidden trait that is
automatically implemented for types that implement Any + Eq + Hash
.
This trait is hidden because it should not be implemented manually.
Trait Implementations§
impl Eq for Key
Auto Trait Implementations§
impl Freeze for Key
impl !RefUnwindSafe for Key
impl !Send for Key
impl !Sync for Key
impl Unpin for Key
impl !UnwindSafe for Key
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
Source§fn convert_into(self) -> U
fn convert_into(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined range,
otherwise an
OutOfBounds
error is returned which contains the unclamped color. Read more