(&self)
| 167 | } |
| 168 | |
| 169 | pub fn get_json_string(&self) -> Result<BnString, ()> { |
| 170 | match self.get_type() { |
| 171 | MetadataType::StringDataType => { |
| 172 | let ptr: *mut c_char = unsafe { BNMetadataGetJsonString(self.handle) }; |
| 173 | if ptr.is_null() { |
| 174 | return Err(()); |
| 175 | } |
| 176 | Ok(unsafe { BnString::from_raw(ptr) }) |
| 177 | } |
| 178 | _ => Err(()), |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | pub fn get_raw(&self) -> Result<Vec<u8>, ()> { |
| 183 | match self.get_type() { |
no test coverage detected