Struct Relay
pub struct Relay { /* private fields */ }Expand description
Implementations§
§impl Relay
impl Relay
pub fn new(wake: Arc<dyn Fn() + Send + Sync>) -> Self
pub fn new(wake: Arc<dyn Fn() + Send + Sync>) -> Self
wake makes the engine’s thread take the calls (a wake byte, a
condition variable).
pub fn next(&self) -> Option<RelayedCall>
pub fn next(&self) -> Option<RelayedCall>
The next call to answer, on the engine’s thread.
pub fn reply(&self, id: u64, answer: Value) -> bool
pub fn reply(&self, id: u64, answer: Value) -> bool
Answers call id with {"value": ...} or an error (see the module).
pub fn close(&self)
pub fn close(&self)
Refuses every call from now on (the engine closed).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Relay
impl !RefUnwindSafe for Relay
impl Send for Relay
impl Sync for Relay
impl Unpin for Relay
impl UnsafeUnpin for Relay
impl !UnwindSafe for Relay
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