Trait askama::PrimitiveType

source ·
pub trait PrimitiveType {
    type Value: Copy + Send + Sync + 'static;

    // Required method
    fn get(&self) -> Self::Value;
}
Expand description

A type that is, references, or wraps a primitive type

Required Associated Types§

source

type Value: Copy + Send + Sync + 'static

Required Methods§

source

fn get(&self) -> Self::Value

Implementations on Foreign Types§

source§

impl PrimitiveType for bool

source§

type Value = bool

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for f32

source§

type Value = f32

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for f64

source§

type Value = f64

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for i8

source§

type Value = i8

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for i16

source§

type Value = i16

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for i32

source§

type Value = i32

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for i64

source§

type Value = i64

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for i128

source§

type Value = i128

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for isize

source§

type Value = isize

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for u8

source§

type Value = u8

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for u16

source§

type Value = u16

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for u32

source§

type Value = u32

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for u64

source§

type Value = u64

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for u128

source§

type Value = u128

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for usize

source§

type Value = usize

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroI8

source§

type Value = i8

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroI16

source§

type Value = i16

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroI32

source§

type Value = i32

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroI64

source§

type Value = i64

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroI128

source§

type Value = i128

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroIsize

source§

type Value = isize

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroU8

source§

type Value = u8

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroU16

source§

type Value = u16

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroU32

source§

type Value = u32

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroU64

source§

type Value = u64

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroU128

source§

type Value = u128

source§

fn get(&self) -> Self::Value

source§

impl PrimitiveType for NonZeroUsize

source§

type Value = usize

source§

fn get(&self) -> Self::Value

source§

impl<T> PrimitiveType for Pin<T>
where T: Deref, <T as Deref>::Target: PrimitiveType,

source§

type Value = <<T as Deref>::Target as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + Copy> PrimitiveType for Cell<T>

Implement PrimitiveType for Cell<T>

#[derive(Template)]
#[template(ext = "txt", source = "{{ value as u16 }}")]
struct Test<'a> {
    value: &'a Pin<Rc<Cell<Saturating<NonZeroI16>>>>
}

assert_eq!(
    Test { value: &Rc::pin(Cell::new(Saturating(NonZeroI16::new(-1).unwrap()))) }.to_string(),
    "65535",
);
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for &T

source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for &mut T

source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for Box<T>

Available on crate feature alloc only.
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for Rc<T>

Available on crate feature alloc only.
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for Arc<T>

Available on crate feature alloc only.
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for Ref<'_, T>

source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for RefMut<'_, T>

source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for MutexGuard<'_, T>

Available on crate feature std only.
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for RwLockReadGuard<'_, T>

Available on crate feature std only.
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType + ?Sized> PrimitiveType for RwLockWriteGuard<'_, T>

Available on crate feature std only.
source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType> PrimitiveType for Saturating<T>

source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

source§

impl<T: PrimitiveType> PrimitiveType for Wrapping<T>

source§

type Value = <T as PrimitiveType>::Value

source§

fn get(&self) -> Self::Value

Implementors§