pub unsafe fn insert_rw_buffer(
        &mut self,
        address: Register,
        len: Register,
    ) -> Result<RwAllowBuffer, OverlapError> {
        let address: *mut u8 = address.into();
        let len: usize = len.into();
        if let Some(nonzero_len) = NonZeroUsize::new(len) {
            // The buffer is not zero-sized. Add it to the database (checking it
            // does not overlap an existing buffer).
            // Safety: `len` is nonzero, so by this function's precondition
            // `address` and `len` represent a valid slice.
            unsafe { self.insert_raw(address, nonzero_len) }?;
        }
        Ok(RwAllowBuffer { address, len })
    }
/// Adds a read-write buffer to the database, and returns it as a
/// `RwAllowBuffer`.
///
/// # Safety
/// `address` and `len` must be valid as specified in TRD 104: either `len`
/// is 0 or `address` and `len` represent a valid slice.
Adds a read-write buffer to the database, and returns it as a
`RwAllowBuffer`.
Adds a read - write buffer to the database and returns it as a ` RwAllowBuffer ` .
pub unsafe fn insert_rw_buffer(
        &mut self,
        address: Register,
        len: Register,
    ) -> Result<RwAllowBuffer, OverlapError> {
        let address: *mut u8 = address.into();
        let len: usize = len.into();
        if let Some(nonzero_len) = NonZeroUsize::new(len) {
            // The buffer is not zero-sized. Add it to the database (checking it
            // does not overlap an existing buffer).
            // Safety: `len` is nonzero, so by this function's precondition
            // `address` and `len` represent a valid slice.
            unsafe { self.insert_raw(address, nonzero_len) }?;
        }
        Ok(RwAllowBuffer { address, len })
    }
pub unsafe fn insert_rw_buffer ( & mut self , address : Register , len : Register , ) -> Result < RwAllowBuffer , OverlapError > { let address : * mut u8 = address . into ( ) ; let len : usize = len . into ( ) ; if let Some ( nonzero_len ) = NonZeroUsize :: new ( len ) { // The buffer is not zero-sized. Add it to the database (checking it // does not overlap an existing buffer). // Safety: `len` is nonzero, so by this function's precondition // `address` and `len` represent a valid slice. unsafe { self . insert_raw ( address , nonzero_len ) } ? ; } Ok ( RwAllowBuffer { address , len } ) }
Adds a read-write buffer to the database, and returns it as a
`RwAllowBuffer`.
Adds a read - write buffer to the database and returns it as a ` RwAllowBuffer ` .
&mut self
address
Register
len
Register
&mut self
address
Register
len
Register
safety
`address` and `len` must be valid as specified in TRD 104: either `len`
is 0 or `address` and `len` represent a valid slice.
` address ` and ` len ` must be valid as specified in TRD 104 : either ` len ` is 0 or ` address ` and ` len ` represent a valid slice .