cache_padded

Struct CachePadded

Source
#[repr(align(128))]
pub struct CachePadded<T>(/* private fields */);
๐Ÿ‘ŽDeprecated since 1.3.0: This crate is now deprecated in favor of crossbeam-utils::CachePadded.
Expand description

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

Implementationsยง

Sourceยง

impl<T> CachePadded<T>

Source

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

๐Ÿ‘ŽDeprecated since 1.3.0: This crate is now deprecated in favor of crossbeam-utils::CachePadded.

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

ยงExamples
use cache_padded::CachePadded;

let padded = CachePadded::new(1);
Source

pub fn into_inner(self) -> T

๐Ÿ‘ŽDeprecated since 1.3.0: This crate is now deprecated in favor of crossbeam-utils::CachePadded.

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ยง

Sourceยง

impl<T: Clone> Clone for CachePadded<T>

Sourceยง

fn clone(&self) -> CachePadded<T>

Returns a copy 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<T: Debug> Debug for CachePadded<T>

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<T: Default> Default for CachePadded<T>

Sourceยง

fn default() -> CachePadded<T>

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<T> Deref for CachePadded<T>

Sourceยง

type Target = T

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &T

Dereferences the value.
Sourceยง

impl<T> DerefMut for CachePadded<T>

Sourceยง

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

Mutably dereferences the value.
Sourceยง

impl<T> From<T> for CachePadded<T>

Sourceยง

fn from(t: T) -> Self

Converts to this type from the input type.
Sourceยง

impl<T: Hash> Hash for CachePadded<T>

Sourceยง

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 ยท Sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl<T: PartialEq> PartialEq for CachePadded<T>

Sourceยง

fn eq(&self, other: &CachePadded<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl<T: Copy> Copy for CachePadded<T>

Sourceยง

impl<T: Eq> Eq for CachePadded<T>

Sourceยง

impl<T> StructuralPartialEq for CachePadded<T>

Auto Trait Implementationsยง

ยง

impl<T> Freeze for CachePadded<T>
where T: Freeze,

ยง

impl<T> RefUnwindSafe for CachePadded<T>
where T: RefUnwindSafe,

ยง

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,

ยง

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

Sourceยง

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

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Sourceยง

impl<T> From<!> for T

Sourceยง

fn from(t: !) -> T

Converts to this type from the input type.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Sourceยง

type Target = T

๐Ÿ”ฌThis is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.