pub struct BridgeCall { /* private fields */ }Expand description
Implementations§
Source§impl BridgeCall
impl BridgeCall
Sourcepub fn new(input: FfiBuffer) -> Self
pub fn new(input: FfiBuffer) -> Self
Create a BridgeCall from an input buffer received over FFI.
Sourcepub fn run<F>(self, handler: F) -> FfiResult
pub fn run<F>(self, handler: F) -> FfiResult
Execute handler with the input buffer and return an FfiResult.
The closure is run inside catch_panic, so panics are safely
converted to FfiErrorCode::Panic results.
Sourcepub fn run_json<I, O, F>(self, handler: F) -> FfiResultwhere
I: DeserializeOwned + UnwindSafe,
O: Serialize,
F: FnOnce(I) -> Result<O, FfiError> + UnwindSafe,
pub fn run_json<I, O, F>(self, handler: F) -> FfiResultwhere
I: DeserializeOwned + UnwindSafe,
O: Serialize,
F: FnOnce(I) -> Result<O, FfiError> + UnwindSafe,
Execute handler with a JSON-deserialized input value.
Deserializes I from the input buffer’s JSON content, then calls
handler. The output is serialized back to JSON and returned.
Sourcepub fn into_buffer(self) -> FfiBuffer
pub fn into_buffer(self) -> FfiBuffer
Return the raw input buffer (consumes self).
Auto Trait Implementations§
impl Freeze for BridgeCall
impl RefUnwindSafe for BridgeCall
impl Send for BridgeCall
impl Sync for BridgeCall
impl Unpin for BridgeCall
impl UnsafeUnpin for BridgeCall
impl UnwindSafe for BridgeCall
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more