pub fn property_value(&self, name: &str) -> Result<Option<String>, Error> {
        let prop_name = match CString::new(name) {
            Ok(c) => c,
            Err(e) => {
                return Err(Error::new(format!(
                    "Failed to convert property name to CString: {}",
                    e
                )));
            }
        };

        unsafe {
            let value = ffi::rocksdb_property_value(self.inner, prop_name.as_ptr());
            if value.is_null() {
                return Ok(None);
            }

            let str_value = match CStr::from_ptr(value).to_str() {
                Ok(s) => s.to_owned(),
                Err(e) => {
                    return Err(Error::new(format!(
                        "Failed to convert property value to string: {}",
                        e
                    )));
                }
            };

            libc::free(value as *mut c_void);
            Ok(Some(str_value))
        }
    }
/// Retrieves a RocksDB property by name.
///
/// For a full list of properties, see
/// https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L428-L634
Retrieves a RocksDB property by name.
Retrieves a RocksDB property by name .
pub fn property_value(&self, name: &str) -> Result<Option<String>, Error> {
        let prop_name = match CString::new(name) {
            Ok(c) => c,
            Err(e) => {
                return Err(Error::new(format!(
                    "Failed to convert property name to CString: {}",
                    e
                )));
            }
        };
        unsafe {
            let value = ffi::rocksdb_property_value(self.inner, prop_name.as_ptr());
            if value.is_null() {
                return Ok(None);
            }
            let str_value = match CStr::from_ptr(value).to_str() {
                Ok(s) => s.to_owned(),
                Err(e) => {
                    return Err(Error::new(format!(
                        "Failed to convert property value to string: {}",
                        e
                    )));
                }
            };
            libc::free(value as *mut c_void);
            Ok(Some(str_value))
        }
    }
pub fn property_value ( & self , name : & str ) -> Result < Option < String > , Error > { let prop_name = match CString :: new ( name ) { Ok ( c ) => c , Err ( e ) => { return Err ( Error :: new ( format ! ( " " e ) ) ) ; } } ; unsafe { let value = ffi :: rocksdb_property_value ( self . inner , prop_name . as_ptr ( ) ) ; if value . is_null ( ) { return Ok ( None ) ; } let str_value = match CStr :: from_ptr ( value ) . to_str ( ) { Ok ( s ) => s . to_owned ( ) , Err ( e ) => { return Err ( Error :: new ( format ! ( " " e ) ) ) ; } } ; libc :: free ( value as * mut c_void ) ; Ok ( Some ( str_value ) ) } }
Retrieves a RocksDB property by name.
Retrieves a RocksDB property by name .
&self
name
&str
&self
name
&str