pub struct Handle {
pub memory: ManagedMemoryHandle,
pub offset_start: Option<u64>,
pub offset_end: Option<u64>,
pub stream: StreamId,
/* private fields */
}Expand description
Server handle containing the memory handle.
Fields§
§memory: ManagedMemoryHandleMemory handle.
offset_start: Option<u64>Memory offset in bytes.
offset_end: Option<u64>Memory offset in bytes.
stream: StreamIdThe stream where the data was created.
Implementations§
Source§impl Handle
impl Handle
Sourcepub fn from_memory(id: ManagedMemoryHandle, stream: StreamId, size: u64) -> Self
pub fn from_memory(id: ManagedMemoryHandle, stream: StreamId, size: u64) -> Self
Creates a new handle of the given size.
Sourcepub fn can_mut(&self) -> bool
pub fn can_mut(&self) -> bool
Checks whether the handle can be mutated in-place without affecting other computation.
Sourcepub fn offset_start(self, offset: u64) -> Self
pub fn offset_start(self, offset: u64) -> Self
Add to the current offset in bytes.
Sourcepub fn offset_end(self, offset: u64) -> Self
pub fn offset_end(self, offset: u64) -> Self
Add to the current offset in bytes.
Sourcepub fn copy_descriptor(
self,
shape: Shape,
strides: Strides,
elem_size: usize,
) -> CopyDescriptor
pub fn copy_descriptor( self, shape: Shape, strides: Strides, elem_size: usize, ) -> CopyDescriptor
Sourcepub fn size_in_used(&self) -> u64
pub fn size_in_used(&self) -> u64
Get the size of the handle, in bytes, accounting for offsets
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl !RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
impl !UnwindSafe for Handle
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