]>
git.proxmox.com Git - rustc.git/blob - src/libstd/sync/mpsc/cache_aligned.rs
1 use crate::ops
::{Deref, DerefMut}
;
3 #[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
5 pub(super) struct Aligner
;
7 #[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 pub(super) struct CacheAligned
<T
>(pub T
, pub Aligner
);
10 impl<T
> Deref
for CacheAligned
<T
> {
12 fn deref(&self) -> &Self::Target
{
17 impl<T
> DerefMut
for CacheAligned
<T
> {
18 fn deref_mut(&mut self) -> &mut Self::Target
{
23 impl<T
> CacheAligned
<T
> {
24 pub(super) fn new(t
: T
) -> Self {
25 CacheAligned(t
, Aligner
)