pub fn open(&self, read_write: bool) -> Result<Descriptor, CoreError> {
        let mut descriptor = std::ptr::null_mut();
        let cname = CString::new(self.name()).unwrap();
        let rc = unsafe {
            spdk_bdev_open_ext(
                cname.as_ptr(),
                read_write,
                Some(Self::event_cb),
                std::ptr::null_mut(),
                &mut descriptor,
            )
        };

        if rc != 0 {
            Err(CoreError::OpenBdev {
                source: Errno::from_i32(rc),
            })
        } else {
            Ok(Descriptor::from_null_checked(descriptor).unwrap())
        }
    }
/// open the current bdev, the bdev can be opened multiple times resulting
/// in a new descriptor for each call.
open the current bdev, the bdev can be opened multiple times resulting
in a new descriptor for each call.
open the current bdev the bdev can be opened multiple times resulting in a new descriptor for each call .
pub fn open(&self, read_write: bool) -> Result<Descriptor, CoreError> {
        let mut descriptor = std::ptr::null_mut();
        let cname = CString::new(self.name()).unwrap();
        let rc = unsafe {
            spdk_bdev_open_ext(
                cname.as_ptr(),
                read_write,
                Some(Self::event_cb),
                std::ptr::null_mut(),
                &mut descriptor,
            )
        };
        if rc != 0 {
            Err(CoreError::OpenBdev {
                source: Errno::from_i32(rc),
            })
        } else {
            Ok(Descriptor::from_null_checked(descriptor).unwrap())
        }
    }
pub fn open ( & self , read_write : bool ) -> Result < Descriptor , CoreError > { let mut descriptor = std :: ptr :: null_mut ( ) ; let cname = CString :: new ( self . name ( ) ) . unwrap ( ) ; let rc = unsafe { spdk_bdev_open_ext ( cname . as_ptr ( ) , read_write , Some ( Self :: event_cb ) , std :: ptr :: null_mut ( ) , & mut descriptor , ) } ; if rc != 0 { Err ( CoreError :: OpenBdev { source : Errno :: from_i32 ( rc ) , } ) } else { Ok ( Descriptor :: from_null_checked ( descriptor ) . unwrap ( ) ) } }
open the current bdev, the bdev can be opened multiple times resulting
in a new descriptor for each call.
open the current bdev the bdev can be opened multiple times resulting in a new descriptor for each call .
&self
read_write
bool