Enum Key

#[non_exhaustive]
pub enum Key<'a>

The key of anything looking like a hashmap (struct/hashmaps)

Variants

Bool(bool)
U64(u64)
I64(i64)
U128(u128)
I128(i128)
String(Arc<str>)
Str(&'a str)

Implementations

impl<'a> Key<'a>

fn as_str(&self) -> Option<&str>

Returns the content if the key is a string

fn as_value(&self) -> Value

Trait Implementations

impl From<&'static str> for Key<'static>

fn from(value: &'static str) -> Self

impl From<String> for Key<'static>

fn from(value: String) -> Self

impl From<i128> for Key<'static>

fn from(value: i128) -> Self

impl From<u128> for Key<'static>

fn from(value: u128) -> Self

impl<'a> Clone for Key<'a>

fn clone(&self) -> Self

impl<'a> Debug for Key<'a>

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

impl<'a> Display for Key<'a>

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

impl<'a> Eq for Key<'a>

impl<'a> From<Cow<'a, str>> for Key<'static>

fn from(value: Cow<'a, str>) -> Self

impl<'a> Hash for Key<'a>

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

impl<'a> Ord for Key<'a>

fn cmp(&self, other: &Self) -> Ordering

impl<'a> PartialEq for Key<'a>

fn eq(&self, other: &Self) -> bool

impl<'a> PartialOrd for Key<'a>

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

impl<'a> Serialize for Key<'a>

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,

Auto Trait Implementations

impl<'a> Freeze for Key<'a>

impl<'a> RefUnwindSafe for Key<'a>

impl<'a> Send for Key<'a>

impl<'a> Sync for Key<'a>

impl<'a> Unpin for Key<'a>

impl<'a> UnsafeUnpin for Key<'a>

impl<'a> UnwindSafe for Key<'a>

Blanket Implementations

impl<I> FunctionResult for Key<'a> where I: Into<Value>,

impl<T> Any for Key<'a> where T: 'static + ?Sized,

impl<T> Borrow<T> for Key<'a> where T: ?Sized,

impl<T> BorrowMut<T> for Key<'a> where T: ?Sized,

impl<T> CloneToUninit for Key<'a> where T: Clone,

impl<T> From<T> for Key<'a>

impl<T> ToOwned for Key<'a> where T: Clone,

impl<T> ToString for Key<'a> where T: Display + ?Sized,

impl<T, U> Into<U> for Key<'a> where U: From<T>,

impl<T, U> TryFrom<U> for Key<'a> where U: Into<T>,

impl<T, U> TryInto<U> for Key<'a> where U: TryFrom<T>,