pub struct Bridge<Eff, A>{ /* 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<Eff, A> Bridge<Eff, A>
impl<Eff, A> Bridge<Eff, A>
sourcepub fn process_event(&self, event: &[u8]) -> Vec<u8>where
A::Event: for<'a> Deserialize<'a>,
pub fn process_event(&self, event: &[u8]) -> Vec<u8>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.
sourcepub fn handle_response(&self, id: u32, output: &[u8]) -> Vec<u8>where
A::Event: for<'a> Deserialize<'a>,
pub fn handle_response(&self, id: u32, output: &[u8]) -> Vec<u8>where
A::Event: for<'a> Deserialize<'a>,
Receive a response to a capability request from the shell.
The output
is serialized capability output. It will be deserialized by the core.
The id
MUST match the id
of the effect that triggered it, else the core will panic.
Auto Trait Implementations§
impl<Eff, A> !Freeze for Bridge<Eff, A>
impl<Eff, A> RefUnwindSafe for Bridge<Eff, A>
impl<Eff, A> Send for Bridge<Eff, A>
impl<Eff, A> Sync for Bridge<Eff, A>
impl<Eff, A> Unpin for Bridge<Eff, A>
impl<Eff, A> UnwindSafe for Bridge<Eff, 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