Skip to main content

PrimitiveType

Trait 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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

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 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<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 Arc<T>

Source§

type Value = <T as PrimitiveType>::Value

Source§

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

Source§

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

Source§

type Value = <T as PrimitiveType>::Value

Source§

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

Source§

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

Source§

type Value = <T as PrimitiveType>::Value

Source§

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

Source§

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

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 RwLockReadGuard<'_, T>

Source§

type Value = <T as PrimitiveType>::Value

Source§

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

Source§

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

Source§

type Value = <T 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> 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

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

Implementors§