(
ctxt: *mut c_void,
)
| 115 | } |
| 116 | |
| 117 | unsafe extern "C" fn cb_create_client<W: WebsocketProvider>( |
| 118 | ctxt: *mut c_void, |
| 119 | ) -> *mut BNWebsocketClient { |
| 120 | let ctxt: &mut W = &mut *(ctxt as *mut W); |
| 121 | match ctxt.create_client() { |
| 122 | Ok(owned_client) => { |
| 123 | // SAFETY: The caller is assumed to have picked up this ref. |
| 124 | Ref::into_raw(owned_client).handle.as_ptr() |
| 125 | } |
| 126 | Err(_) => std::ptr::null_mut(), |
| 127 | } |
| 128 | } |
nothing calls this directly
no test coverage detected