pub struct AlignedDestination(/* private fields */);Expand description
What SystemDestinations hands out: one host allocation at the declared alignment.
A named type because DestinationAlloc::Dest is part of the public API; the
allocation itself stays an implementation detail.
§Examples
use hurray_io::stream::{Destination, DestinationAlloc, DestinationRequest, SystemDestinations};
let mut dest = SystemDestinations
.allocate(DestinationRequest { index: 0, byte_size: 32, alignment: 128 })?;
dest.as_mut_slice().fill(0xAB);
let frozen = dest.freeze();
assert_eq!(frozen.len(), 32);
assert_eq!(frozen.as_ptr() as usize % 128, 0);Trait Implementations§
Source§impl Destination for AlignedDestination
impl Destination for AlignedDestination
Auto Trait Implementations§
impl Freeze for AlignedDestination
impl RefUnwindSafe for AlignedDestination
impl Send for AlignedDestination
impl Sync for AlignedDestination
impl Unpin for AlignedDestination
impl UnsafeUnpin for AlignedDestination
impl UnwindSafe for AlignedDestination
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more