QlStatus

Struct QlStatus 

Source
pub struct QlStatus<P> { /* private fields */ }
Expand description

reactive handle to latest QuantumLink status

Implementations§

Source§

impl<P> QlStatus<P>
where P: CheckedPermissions + 'static,

Source

pub fn new(worker: WorkerHandle) -> Self

Permission: os/quantum-link / SubscribeConnectionStatus

Groups: network-and-pairing.device-link-status

Sender policy: signed

Grant timing: install-review

Source

pub async fn ready(&self)

Permission: none

wait until bluetooth is connected, device is paired, and connection is confirmed as live

Source

pub async fn bt_ready(&self)

Permission: none

wait until bluetooth is connected

Source

pub fn is_connected(&self) -> bool

Permission: none

check if fully connected (BT + paired)

Source

pub fn send_ql_archive<M>(&self, msg: M) -> impl Future<Output = M::Response>
where P: MessageAllowed<M>, M: BlockingArchive + Send + 'static, M::Response: Send,

Permission: TBD (MessageAllowed<M>)

Groups: TBD

Sender policy: TBD

Grant timing: TBD

Source

pub fn send_ql_archive_retry<M, T, E>( &self, msg: M, error: impl FnMut(E) + Send + 'static, ) -> impl Future<Output = T>
where P: CheckedPermissions + MessageAllowed<M>, M: BlockingArchive<Response = Result<T, E>> + Send + Clone + 'static, M::Response: Send, T: ArchiveCodec + Send + 'static, <T as Archive>::Archived: Deserialize<T, XousDeserializer> + for<'a> CheckBytes<XousValidator<'a>>, E: ArchiveCodec + Send + 'static, <E as Archive>::Archived: Deserialize<E, XousDeserializer> + for<'a> CheckBytes<XousValidator<'a>>,

Permission: TBD (MessageAllowed<M>)

Groups: TBD

Sender policy: TBD

Grant timing: TBD

Source

pub fn into_inner(self) -> StreamWatch<ConnectionStatus>

Permission: none

Methods from Deref<Target = StreamWatch<ConnectionStatus>>§

pub async fn wait_until(&self, predicate: impl FnMut(&T) -> bool)

wait until a predicate is satisfied.

pub fn current(&self) -> T

get the current value

pub fn borrow(&self) -> Ref<'_, T>

borrow the current value

pub async fn next(&mut self) -> Option<T>

wait for the next event

Trait Implementations§

Source§

impl<P: Clone> Clone for QlStatus<P>

Source§

fn clone(&self) -> QlStatus<P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P> Deref for QlStatus<P>

Source§

type Target = StreamWatch<ConnectionStatus>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<P> DerefMut for QlStatus<P>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<P> Freeze for QlStatus<P>

§

impl<P> RefUnwindSafe for QlStatus<P>

§

impl<P> Send for QlStatus<P>

§

impl<P> Sync for QlStatus<P>

§

impl<P> Unpin for QlStatus<P>

§

impl<P> UnwindSafe for QlStatus<P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T