SizeSmallerOrEqualTo

Struct SizeSmallerOrEqualTo 

Source
pub struct SizeSmallerOrEqualTo<T, Size>(/* private fields */);
Expand description

Assert size of T is smaller or equal to given size.

§Examples

use dungeon_cell::compile_time::{SizeSmallerOrEqualTo, UsizeAssert};
use dungeon_cell::layout::Size;

// this will pass
SizeSmallerOrEqualTo::<u16, Size<4>>::assert();
use dungeon_cell::compile_time::{SizeSmallerOrEqualTo, UsizeAssert};
use dungeon_cell::Size;

// this won't pass
SizeSmallerOrEqualTo::<u16, Size<1>>::assert();

Trait Implementations§

Source§

impl<T, Size: IsSize> UsizeAssert for SizeSmallerOrEqualTo<T, Size>

Source§

const LHS: usize

Left hand side of the comparison. Read more
Source§

const RHS: usize = Size::VALUE

Right hand side of the comparison. Read more
Source§

const COMPARE: Comparison = Comparison::LessThanEqual

Type of comparison to make between Self::LHS and Self::RHS.
Source§

const PROPERTY: &'static str = "size"

Same of the property being checked. Read more
Source§

type Type = T

Type with the property being checked.
Source§

const FAILED: bool = _

Associated constant used to trigger compile time errors. Read more
Source§

fn assert()

Assert the defined comparison is true. Read more

Auto Trait Implementations§

§

impl<T, Size> Freeze for SizeSmallerOrEqualTo<T, Size>

§

impl<T, Size> RefUnwindSafe for SizeSmallerOrEqualTo<T, Size>
where T: RefUnwindSafe, Size: RefUnwindSafe,

§

impl<T, Size> Send for SizeSmallerOrEqualTo<T, Size>
where T: Send, Size: Send,

§

impl<T, Size> Sync for SizeSmallerOrEqualTo<T, Size>
where T: Sync, Size: Sync,

§

impl<T, Size> Unpin for SizeSmallerOrEqualTo<T, Size>
where T: Unpin, Size: Unpin,

§

impl<T, Size> UnwindSafe for SizeSmallerOrEqualTo<T, Size>
where T: UnwindSafe, Size: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> Dynamic<Bound<Send, Sync, __, __, Unpin, __>> for T
where T: Send + Sync + Unpin,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<Send, Sync, __, __, __, __>> for T
where T: Send + Sync,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<Send, __, __, __, Unpin, __>> for T
where T: Send + Unpin,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<Send, __, __, __, __, __>> for T
where T: Send,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<__, Sync, __, __, Unpin, __>> for T
where T: Sync + Unpin,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<__, Sync, __, __, __, __>> for T
where T: Sync,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<__, __, __, __, Unpin, __>> for T
where T: Unpin,

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> Dynamic<Bound<__, __, __, __, __, __>> for T

Source§

unsafe fn clone_unchecked(_this: &T) -> T

Unsafe form of Self::clone(). Read more
Source§

unsafe fn debug_unchecked( _this: &T, _f: &mut Formatter<'_>, ) -> Result<(), Error>

Unsafe form of Self::debug(). Read more
Source§

fn clone(this: &Self) -> Self
where Self: Sized, <B as IsBound>::CloneMarker: Clone,

Call the Clone::clone() implementation of Self. Read more
Source§

fn debug(this: &Self, f: &mut Formatter<'_>) -> Result<(), Error>
where Self: Sized, <B as IsBound>::DebugMarker: Debug,

Call the Debug::fmt() implementation of Self. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Inspect<Static> for T
where T: 'static,

Source§

fn inspect() -> Static

Get the T for Self.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.