Get the Remote for a Database
(database: &Database)
| 137 | |
| 138 | /// Get the Remote for a Database |
| 139 | pub fn get_remote_for_local_database(database: &Database) -> Result<Option<Ref<Remote>>, ()> { |
| 140 | let mut value = std::ptr::null_mut(); |
| 141 | let success = |
| 142 | unsafe { BNCollaborationGetRemoteForLocalDatabase(database.handle.as_ptr(), &mut value) }; |
| 143 | success |
| 144 | .then(|| NonNull::new(value).map(|handle| unsafe { Remote::ref_from_raw(handle) })) |
| 145 | .ok_or(()) |
| 146 | } |
| 147 | |
| 148 | /// Get the Remote for a BinaryView |
| 149 | pub fn get_remote_for_binary_view(bv: &BinaryView) -> Result<Option<Ref<Remote>>, ()> { |
no test coverage detected