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§
Required Methods§
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 NonZeroI128
impl PrimitiveType for NonZeroI128
Source§impl PrimitiveType for NonZeroIsize
impl PrimitiveType for NonZeroIsize
Source§impl PrimitiveType for NonZeroU128
impl PrimitiveType for NonZeroU128
Source§impl PrimitiveType for NonZeroUsize
impl PrimitiveType for NonZeroUsize
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for &T
impl<T: PrimitiveType + ?Sized> PrimitiveType for &T
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for &mut T
impl<T: PrimitiveType + ?Sized> PrimitiveType for &mut T
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for Arc<T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for Arc<T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for Box<T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for Box<T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for MutexGuard<'_, T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for MutexGuard<'_, T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for Rc<T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for Rc<T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for Ref<'_, T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for Ref<'_, T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for RefMut<'_, T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for RefMut<'_, T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for RwLockReadGuard<'_, T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for RwLockReadGuard<'_, T>
Source§impl<T: PrimitiveType + ?Sized> PrimitiveType for RwLockWriteGuard<'_, T>
impl<T: PrimitiveType + ?Sized> PrimitiveType for RwLockWriteGuard<'_, T>
Source§impl<T: PrimitiveType + Copy> PrimitiveType for Cell<T>
Implement PrimitiveType for Cell<T>
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",
);