Layout

Struct Layout 

Source
pub struct Layout<Size: IsSize, Alignment: IsAlignment> { /* private fields */ }
Expand description

Combination of size and alignment.

This is the type to use where a IsLayout generic is required.

Unlike the std::alloc::Layout, this type is for layouts known at compile time. Additionally, this type doesn’t require size to be a multiple of alignment.

The layout given to a dungeon_cell type determines the types it can store. To find the layout for a given set of types the layout_for!() macro can be used.

§Examples

use dungeon_cell::layout::{Layout, Size, Alignment};

type Test = Layout<Size<4>, Alignment<2>>;

assert_eq!(Test::size(), 4);
assert_eq!(Test::alignment(), 2);

Implementations§

Source§

impl<Size: IsSize, Alignment: IsAlignment> Layout<Size, Alignment>

Source

pub const fn is_layout_of<T>() -> bool

Check if this layout exactly matches the layout for T.

§Examples
use dungeon_cell::layout::{Layout, Size, Alignment};

type TestLayout = Layout<Size<4>, Alignment<4>>;

assert!(TestLayout::is_layout_of::<i32>());
assert!(!TestLayout::is_layout_of::<i16>());
Source

pub const fn size() -> usize

Size in bytes.

This is the value of S::VALUE.

§Examples
use dungeon_cell::layout_for;

assert_eq!(<layout_for!(String)>::size(), 24);
Source

pub const fn alignment() -> usize

Alignment in bytes.

This is the value of Alignment::VALUE.

§Examples
use dungeon_cell::layout_for;

assert_eq!(<layout_for!(String)>::alignment(), 8);
Source

pub const fn to_std_layout() -> Result<Layout, LayoutError>

Create a std::alloc::Layout with the size and alignment of this layout.

This function is available on no_std.

§Examples
use dungeon_cell::layout_for;
use std::alloc::Layout;

let l: Layout = <layout_for!(String)>::to_std_layout().unwrap();

assert_eq!(l.size(), 24);
assert_eq!(l.align(), 8);
Source

pub const fn can_store<T>() -> bool

Check if memory with this layout would allow a T to be stored.

This checks that the size of T is equal or less than Self::size(), and that the alignment of T is equal or less than Self::alignment().

§Examples
use dungeon_cell::layout_for;

type LayoutI32 = layout_for!(i32);

assert!(LayoutI32::can_store::<u8>());
assert!(LayoutI32::can_store::<u16>());
assert!(LayoutI32::can_store::<i32>());
assert!(!LayoutI32::can_store::<String>());
Source

pub fn assert_can_store<T>()

Assert memory with this layout can store a value of T.

This checks that the size of T is equal or less than Self::size(), and that the alignment of T is equal or less than Self::alignment().

Unsafe code can use the above if this function returns.

This function uses the assert system in compile_time which means by default it will cause a compile time error if the assertion fails.

§Examples
use dungeon_cell::layout_for;

// a i16 is smaller than a i32
<layout_for!(i32)>::assert_can_store::<i16>();
use dungeon_cell::layout_for;

// a i32 is bigger than a i16
<layout_for!(i16)>::assert_can_store::<i32>();
Source

pub const fn const_assert_can_store<T>()

Const form of Self::assert_can_store().

Prefer using Self::assert_can_store() if possible because it can give better error messages.

§Examples
use dungeon_cell::layout_for;

const fn test() {
    // a i16 is smaller than a i32
    <layout_for!(i32)>::const_assert_can_store::<i16>();
}

test();
use dungeon_cell::layout_for;

const fn test() {
    // a i32 is bigger than a i16
    <layout_for!(i16)>::const_assert_can_store::<i32>();
}

test();

Trait Implementations§

Source§

impl<Size: Clone + IsSize, Alignment: Clone + IsAlignment> Clone for Layout<Size, Alignment>

Source§

fn clone(&self) -> Layout<Size, Alignment>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Size: IsSize, Alignment: IsAlignment> IsLayout for Layout<Size, Alignment>

Source§

type Size = Size

Size of the layout.
Source§

type Alignment = Alignment

Alignment requirement of the layout;
Source§

impl<Size: Copy + IsSize, Alignment: Copy + IsAlignment> Copy for Layout<Size, Alignment>

Auto Trait Implementations§

§

impl<Size, Alignment> Freeze for Layout<Size, Alignment>

§

impl<Size, Alignment> RefUnwindSafe for Layout<Size, Alignment>

§

impl<Size, Alignment> Send for Layout<Size, Alignment>

§

impl<Size, Alignment> Sync for Layout<Size, Alignment>

§

impl<Size, Alignment> Unpin for Layout<Size, Alignment>

§

impl<Size, Alignment> UnwindSafe for Layout<Size, Alignment>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Dynamic<Bound<Send, Sync, Copy, Clone, Unpin, __>> for T
where T: Send + Sync + Copy + Clone + 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, Copy, Clone, __, __>> for T
where T: Send + Sync + Copy + Clone,

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, Copy, __, Unpin, __>> for T
where T: Send + Sync + Copy + 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, Copy, __, __, __>> for T
where T: Send + Sync + Copy,

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, __, Clone, Unpin, __>> for T
where T: Send + Sync + Clone + 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, __, Clone, __, __>> for T
where T: Send + Sync + Clone,

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, __, __, 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, __, Copy, Clone, Unpin, __>> for T
where T: Send + Copy + Clone + 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, __, Copy, Clone, __, __>> for T
where T: Send + Copy + Clone,

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, __, Copy, __, Unpin, __>> for T
where T: Send + Copy + 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, __, Copy, __, __, __>> for T
where T: Send + Copy,

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, __, __, Clone, Unpin, __>> for T
where T: Send + Clone + 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, __, __, Clone, __, __>> for T
where T: Send + Clone,

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, Copy, Clone, Unpin, __>> for T
where T: Sync + Copy + Clone + 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, Copy, Clone, __, __>> for T
where T: Sync + Copy + Clone,

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, Copy, __, Unpin, __>> for T
where T: Sync + Copy + 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, Copy, __, __, __>> for T
where T: Sync + Copy,

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, __, Clone, Unpin, __>> for T
where T: Sync + Clone + 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, __, Clone, __, __>> for T
where T: Sync + Clone,

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<__, __, Copy, Clone, Unpin, __>> for T
where T: Copy + Clone + 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<__, __, Copy, Clone, __, __>> for T
where T: Copy + Clone,

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<__, __, Copy, __, Unpin, __>> for T
where T: Copy + 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<__, __, Copy, __, __, __>> for T
where T: Copy,

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<__, __, __, Clone, Unpin, __>> for T
where T: Clone + 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<__, __, __, Clone, __, __>> for T
where T: Clone,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.