pub struct Kind(/* private fields */);
Expand description
Kind describes the type of entity represented by a Context. The meaning of a kind is entirely up to the application. To construct a custom kind other than “user”, see Kind::try_from.
Implementations§
Source§impl Kind
impl Kind
Sourcepub fn is_user(&self) -> bool
pub fn is_user(&self) -> bool
Returns true if the kind is “user”. Users are the default context kind created by crate::ContextBuilder.
Sourcepub fn is_multi(&self) -> bool
pub fn is_multi(&self) -> bool
Returns true if the kind is “multi”. Multi-contexts are created by crate::MultiContextBuilder.
Sourcepub fn user() -> Self
pub fn user() -> Self
Constructs a kind of type “user”. See also Kind::try_from to create a custom kind, which may then be passed to crate::ContextBuilder::kind.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Kind
impl<'de> Deserialize<'de> for Kind
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 Ord for Kind
impl Ord for Kind
Source§impl PartialOrd for Kind
impl PartialOrd for Kind
Source§impl TryFrom<String> for Kind
impl TryFrom<String> for Kind
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.