pub struct LayeredKey<R: Copy + Debug + PartialEq, const LAYER_COUNT: usize> {
pub base: R,
pub layered: [Option<R>; LAYER_COUNT],
}
Expand description
A key whose behavior depends on which layer is active.
Fields§
§base: R
The base key, used when no layers are active.
layered: [Option<R>; LAYER_COUNT]
The layered keys, used when the corresponding layer is active.
Implementations§
Trait Implementations§
Source§impl<R: Clone + Copy + Debug + PartialEq, const LAYER_COUNT: usize> Clone for LayeredKey<R, LAYER_COUNT>
impl<R: Clone + Copy + Debug + PartialEq, const LAYER_COUNT: usize> Clone for LayeredKey<R, LAYER_COUNT>
Source§fn clone(&self) -> LayeredKey<R, LAYER_COUNT>
fn clone(&self) -> LayeredKey<R, LAYER_COUNT>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<R: Debug + Copy + Debug + PartialEq, const LAYER_COUNT: usize> Debug for LayeredKey<R, LAYER_COUNT>
impl<R: Debug + Copy + Debug + PartialEq, const LAYER_COUNT: usize> Debug for LayeredKey<R, LAYER_COUNT>
Source§impl<'de, R, const LAYER_COUNT: usize> Deserialize<'de> for LayeredKey<R, LAYER_COUNT>
impl<'de, R, const LAYER_COUNT: usize> Deserialize<'de> for LayeredKey<R, LAYER_COUNT>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<R: PartialEq + Copy + Debug + PartialEq, const LAYER_COUNT: usize> PartialEq for LayeredKey<R, LAYER_COUNT>
impl<R: PartialEq + Copy + Debug + PartialEq, const LAYER_COUNT: usize> PartialEq for LayeredKey<R, LAYER_COUNT>
impl<R: Copy + Copy + Debug + PartialEq, const LAYER_COUNT: usize> Copy for LayeredKey<R, LAYER_COUNT>
impl<R: Copy + Debug + PartialEq, const LAYER_COUNT: usize> StructuralPartialEq for LayeredKey<R, LAYER_COUNT>
Auto Trait Implementations§
impl<R, const LAYER_COUNT: usize> Freeze for LayeredKey<R, LAYER_COUNT>where
R: Freeze,
impl<R, const LAYER_COUNT: usize> RefUnwindSafe for LayeredKey<R, LAYER_COUNT>where
R: RefUnwindSafe,
impl<R, const LAYER_COUNT: usize> Send for LayeredKey<R, LAYER_COUNT>where
R: Send,
impl<R, const LAYER_COUNT: usize> Sync for LayeredKey<R, LAYER_COUNT>where
R: Sync,
impl<R, const LAYER_COUNT: usize> Unpin for LayeredKey<R, LAYER_COUNT>where
R: Unpin,
impl<R, const LAYER_COUNT: usize> UnwindSafe for LayeredKey<R, LAYER_COUNT>where
R: UnwindSafe,
Blanket Implementations§
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