pub struct XferDescList<'a> { /* private fields */ }Expand description
A safe wrapper around a NIXL transfer descriptor list
Implementations§
Source§impl<'a> XferDescList<'a>
impl<'a> XferDescList<'a>
Sourcepub fn new(mem_type: MemType) -> Result<Self, NixlError>
pub fn new(mem_type: MemType) -> Result<Self, NixlError>
Creates a new transfer descriptor list for the given memory type
pub fn as_ptr(&self) -> *mut nixl_capi_xfer_dlist_s
Sourcepub fn get_type(&self) -> Result<MemType, NixlError>
pub fn get_type(&self) -> Result<MemType, NixlError>
Returns the memory type of the transfer descriptor list
Sourcepub fn desc_count(&self) -> Result<usize, NixlError>
pub fn desc_count(&self) -> Result<usize, NixlError>
Returns the number of descriptors in the list
Sourcepub fn rem_desc(&mut self, index: i32) -> Result<(), NixlError>
pub fn rem_desc(&mut self, index: i32) -> Result<(), NixlError>
Removes the descriptor at the given index
Sourcepub fn get(&self, index: usize) -> Result<&XferDescriptor, NixlError>
pub fn get(&self, index: usize) -> Result<&XferDescriptor, NixlError>
Safe immutable access to descriptor by index
Sourcepub fn get_mut(
&mut self,
index: usize,
) -> Result<&mut XferDescriptor, NixlError>
pub fn get_mut( &mut self, index: usize, ) -> Result<&mut XferDescriptor, NixlError>
Safe mutable access to descriptor by index
Sourcepub fn add_storage_desc<D: NixlDescriptor + 'a>(
&mut self,
desc: &'a D,
) -> Result<(), NixlError>
pub fn add_storage_desc<D: NixlDescriptor + 'a>( &mut self, desc: &'a D, ) -> Result<(), NixlError>
Add a descriptor from a type implementing NixlDescriptor
§Safety
The caller must ensure that:
- The descriptor remains valid for the lifetime of the list
- The memory region pointed to by the descriptor remains valid
Sourcepub fn serialize(&self) -> Result<Vec<u8>, NixlError>
pub fn serialize(&self) -> Result<Vec<u8>, NixlError>
Serializes the descriptor list to a byte vector using bincode
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, NixlError>
pub fn deserialize(bytes: &[u8]) -> Result<Self, NixlError>
Deserializes a descriptor list from a byte slice using bincode
Trait Implementations§
Source§impl Debug for XferDescList<'_>
impl Debug for XferDescList<'_>
Source§impl Drop for XferDescList<'_>
impl Drop for XferDescList<'_>
Source§impl Index<usize> for XferDescList<'_>
impl Index<usize> for XferDescList<'_>
Source§impl IndexMut<usize> for XferDescList<'_>
impl IndexMut<usize> for XferDescList<'_>
Source§impl PartialEq for XferDescList<'_>
impl PartialEq for XferDescList<'_>
Auto Trait Implementations§
impl<'a> !Freeze for XferDescList<'a>
impl<'a> !RefUnwindSafe for XferDescList<'a>
impl<'a> !Send for XferDescList<'a>
impl<'a> !Sync for XferDescList<'a>
impl<'a> Unpin for XferDescList<'a>
impl<'a> !UnwindSafe for XferDescList<'a>
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