Key

Struct Key 

Source
pub struct Key<S: Schema, T: ?Sized + 'static, const MUT: bool = false> { /* private fields */ }
Expand description

A key for CtxMap.

Use key macro to create Key.

Trait Implementations§

Source§

impl<S, T, const MUT: bool> Index<&'static Key<S, T, MUT>> for CtxMap<S>
where S: Schema, T: ?Sized + 'static,

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: &'static Key<S, T, MUT>) -> &Self::Output

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

impl<'a, S, T, const MUT: bool> Index<&'static Key<S, T, MUT>> for CtxMapView<'a, S>
where S: Schema, T: ?Sized + 'static,

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: &'static Key<S, T, MUT>) -> &Self::Output

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

impl<S, T> IndexMut<&'static Key<S, T, true>> for CtxMap<S>
where S: Schema, T: ?Sized + 'static,

Source§

fn index_mut(&mut self, index: &'static KeyMut<S, T>) -> &mut Self::Output

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

impl<'a, S, T> IndexMut<&'static Key<S, T, true>> for CtxMapView<'a, S>
where S: Schema, T: ?Sized + 'static,

Source§

fn index_mut(&mut self, index: &'static KeyMut<S, T>) -> &mut Self::Output

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

Auto Trait Implementations§

§

impl<S, T, const MUT: bool> Freeze for Key<S, T, MUT>
where T: ?Sized,

§

impl<S, T, const MUT: bool = false> !RefUnwindSafe for Key<S, T, MUT>

§

impl<S, T, const MUT: bool> Send for Key<S, T, MUT>
where S: Send, T: ?Sized,

§

impl<S, T, const MUT: bool> Sync for Key<S, T, MUT>
where S: Sync, T: ?Sized,

§

impl<S, T, const MUT: bool> Unpin for Key<S, T, MUT>
where S: Unpin, T: ?Sized,

§

impl<S, T, const MUT: bool = false> !UnwindSafe for Key<S, T, MUT>

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> 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, 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.