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

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

Implementations

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

Examples
use cache_padded::CachePadded;

let padded = CachePadded::new(1);

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.