[][src]Struct cache_padded::CachePadded

#[repr(align(128))]pub struct CachePadded<T>(_);

Pads and aligns data to the length of a cache line.

Implementations

impl<T> CachePadded<T>[src]

pub const fn new(t: T) -> CachePadded<T>[src]

Pads and aligns a piece of data to the length of a cache line.

Examples

use cache_padded::CachePadded;

let padded = CachePadded::new(1);

pub fn into_inner(self) -> T[src]

Returns the inner data.

Examples

use cache_padded::CachePadded;

let padded = CachePadded::new(7);
let data = padded.into_inner();
assert_eq!(data, 7);

Trait Implementations

impl<T: Clone> Clone for CachePadded<T>[src]

impl<T: Copy> Copy for CachePadded<T>[src]

impl<T: Debug> Debug for CachePadded<T>[src]

impl<T: Default> Default for CachePadded<T>[src]

impl<T> Deref for CachePadded<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for CachePadded<T>[src]

impl<T: Eq> Eq for CachePadded<T>[src]

impl<T> From<T> for CachePadded<T>[src]

impl<T: Hash> Hash for CachePadded<T>[src]

impl<T: PartialEq> PartialEq<CachePadded<T>> for CachePadded<T>[src]

impl<T> StructuralEq for CachePadded<T>[src]

impl<T> StructuralPartialEq for CachePadded<T>[src]

Auto Trait Implementations

impl<T> Send for CachePadded<T> where
    T: Send

impl<T> Sync for CachePadded<T> where
    T: Sync

impl<T> Unpin for CachePadded<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.