pub struct Bridge<Eff, A>where
Eff: Effect,
A: App,{ /* private fields */ }
Expand description
Bridge is a core wrapper presenting the same interface as the Core
but in a
serialized form
Implementations§
source§impl<Eff, A> Bridge<Eff, A>where
Eff: Effect + Send + 'static,
A: App,
impl<Eff, A> Bridge<Eff, A>where Eff: Effect + Send + 'static, A: App,
sourcepub fn process_event<'de>(&self, event: &'de [u8]) -> Vec<u8>where
A::Event: Deserialize<'de>,
pub fn process_event<'de>(&self, event: &'de [u8]) -> Vec<u8>where A::Event: Deserialize<'de>,
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<'de>(&self, uuid: &[u8], output: &'de [u8]) -> Vec<u8>where
A::Event: Deserialize<'de>,
pub fn handle_response<'de>(&self, uuid: &[u8], output: &'de [u8]) -> Vec<u8>where A::Event: Deserialize<'de>,
Receive a response to a capability request from the shell.
The output
is serialized capability output. It will be deserialized by the core.
The uuid
MUST match the uuid
of the effect that triggered it, else the core will panic.
Auto Trait Implementations§
impl<Eff, A> RefUnwindSafe for Bridge<Eff, A>where A: RefUnwindSafe, <A as App>::Capabilities: RefUnwindSafe,
impl<Eff, A> Send for Bridge<Eff, A>where A: Send, <A as App>::Capabilities: Send, <A as App>::Model: Send,
impl<Eff, A> Sync for Bridge<Eff, A>where A: Sync, <A as App>::Capabilities: Sync, <A as App>::Model: Send + Sync,
impl<Eff, A> Unpin for Bridge<Eff, A>where A: Unpin, Eff: Unpin, <A as App>::Capabilities: Unpin, <A as App>::Event: Unpin, <A as App>::Model: Unpin,
impl<Eff, A> UnwindSafe for Bridge<Eff, A>where A: UnwindSafe, <A as App>::Capabilities: UnwindSafe,
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