pub struct Bridge<A>where
A: App,{ /* private fields */ }
Expand description
Bridge is a core wrapper presenting the same interface as the Core
but in a
serialized form, using bincode as the serialization format.
Implementations§
Source§impl<A> Bridge<A>where
A: App,
impl<A> Bridge<A>where
A: App,
Sourcepub fn process_event(&self, event: &[u8]) -> Result<Vec<u8>, BridgeError>where
A::Event: for<'a> Deserialize<'a>,
pub fn process_event(&self, event: &[u8]) -> Result<Vec<u8>, BridgeError>where
A::Event: for<'a> Deserialize<'a>,
Receive an event from the shell.
The event
is serialized and will be deserialized by the core before it’s passed
to your app.
§Errors
Returns an error if the event could not be deserialized.
Sourcepub fn handle_response(
&self,
id: u32,
output: &[u8],
) -> Result<Vec<u8>, BridgeError>where
A::Event: for<'a> Deserialize<'a>,
pub fn handle_response(
&self,
id: u32,
output: &[u8],
) -> Result<Vec<u8>, BridgeError>where
A::Event: for<'a> Deserialize<'a>,
Auto Trait Implementations§
impl<A> !Freeze for Bridge<A>
impl<A> !RefUnwindSafe for Bridge<A>
impl<A> Send for Bridge<A>
impl<A> Sync for Bridge<A>
impl<A> Unpin for Bridge<A>
impl<A> !UnwindSafe for Bridge<A>
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