pub struct CtrlHandle { /* private fields */ }Expand description
Can be obtained via EventStream::hook_remote_control.
Implementations§
Source§impl CtrlHandle
impl CtrlHandle
Sourcepub async fn accept_remote_ctrl<C: ClientApi>(
&self,
client: &C,
link: &str,
) -> Result<(), CtrlError<C::Error>>
pub async fn accept_remote_ctrl<C: ClientApi>( &self, client: &C, link: &str, ) -> Result<(), CtrlError<C::Error>>
Connect to a remote controller using the connection link obtained via SimpleX-Desktop -> link mobile device menu.
§Deadlock warning
This method awaits a remoteCtrlSessionCode event that only arrives when the event loop is
running concurrently. Calling this method from a sequential handler blocks the event loop
and deadlocks. Only call from a concurrent handler or outside the event dispatching logic
entirely.
Trait Implementations§
Source§impl Hook for CtrlHandle
impl Hook for CtrlHandle
Source§fn should_intercept(&self, kind: EventKind) -> bool
fn should_intercept(&self, kind: EventKind) -> bool
Return true if you want to intercept the given event kind.
Self::intercept_event won’t
be called kinds this method returned falseSource§fn intercept_event(&self, event: Event)
fn intercept_event(&self, event: Event)
Hooks must not block the event stream; this method should be a cheap synchronous call.
Delegate heavy work to another thread or spawn async tasks internally.
Auto Trait Implementations§
impl !Freeze for CtrlHandle
impl RefUnwindSafe for CtrlHandle
impl Send for CtrlHandle
impl Sync for CtrlHandle
impl Unpin for CtrlHandle
impl UnsafeUnpin for CtrlHandle
impl UnwindSafe for CtrlHandle
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more