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) -> Key<'a>

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

fn into_result(self) -> TeraResult<Value>

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

fn borrow_mut(&mut self) -> &mut T

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

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

fn from(t: T) -> T

Returns the argument unchanged.

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

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn to_string(&self) -> String

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

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

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

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>