Enum ValueKind
#[non_exhaustive]
pub enum ValueKind
The kind of values Tera can handle
Variants
-
Undefined This is mostly used internally to represent a lookup failure and you're unlikely to need to use that except when writing some special filters/functions that lookups data in the state.
-
None An explicit
Nonevalue: it is there and found, but it isNone.-
Bool -
U64 -
I64 -
U128 -
I128 -
F64 -
String -
Array -
Map -
Bytes If you try to display bytes values in a template (eg
{{ bytes }}) it will try to render it as lossy UTF-8. There is no way to create aValue::Bytesfrom inside a template: it's mostly there for interaction with filters etc
Trait Implementations
impl Clone for ValueKind
fn clone(&self) -> ValueKind
impl Copy for ValueKind
impl Debug for ValueKind
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for ValueKind
impl Hash for ValueKind
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for ValueKind
fn eq(&self, other: &ValueKind) -> bool
impl StructuralPartialEq for ValueKind
Auto Trait Implementations
impl Freeze for ValueKind
impl RefUnwindSafe for ValueKind
impl Send for ValueKind
impl Sync for ValueKind
impl Unpin for ValueKind
impl UnsafeUnpin for ValueKind
impl UnwindSafe for ValueKind
Blanket Implementations
impl<T> Any for ValueKind
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ValueKind
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ValueKind
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ValueKind
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ValueKind
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ValueKind
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for ValueKind
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ValueKind
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 ValueKind
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>