pub struct ConnectionStatus {
pub usb: UsbState,
pub ble: BleStatus,
pub preferred: ConnectionType,
}Expand description
Unified connection status: the single source of truth for transport
availability and routing. The active transport is derived on demand via
Self::decide_active from the input fields below.
Fields§
§usb: UsbState§ble: BleStatus§preferred: ConnectionTypeTiebreaker when both transports are ready.
Implementations§
Source§impl ConnectionStatus
impl ConnectionStatus
Sourcepub fn decide_active(&self) -> Option<ConnectionType>
pub fn decide_active(&self) -> Option<ConnectionType>
Pick the active transport from current readiness + preference. Suspended USB remains routable for remote wakeup, so it participates in the same preference tie-break as configured USB.
Trait Implementations§
Source§impl Clone for ConnectionStatus
impl Clone for ConnectionStatus
Source§fn clone(&self) -> ConnectionStatus
fn clone(&self) -> ConnectionStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ConnectionStatus
Source§impl Debug for ConnectionStatus
impl Debug for ConnectionStatus
Source§impl Default for ConnectionStatus
impl Default for ConnectionStatus
Source§impl<'de> Deserialize<'de> for ConnectionStatus
impl<'de> Deserialize<'de> for ConnectionStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ConnectionStatus
Source§impl MaxSize for ConnectionStatus
impl MaxSize for ConnectionStatus
Source§const POSTCARD_MAX_SIZE: usize
const POSTCARD_MAX_SIZE: usize
The maximum possible size that the serialization of this
type can have, in bytes.
Source§impl PartialEq for ConnectionStatus
impl PartialEq for ConnectionStatus
Source§impl Serialize for ConnectionStatus
impl Serialize for ConnectionStatus
impl StructuralPartialEq for ConnectionStatus
Auto Trait Implementations§
impl Freeze for ConnectionStatus
impl RefUnwindSafe for ConnectionStatus
impl Send for ConnectionStatus
impl Sync for ConnectionStatus
impl Unpin for ConnectionStatus
impl UnsafeUnpin for ConnectionStatus
impl UnwindSafe for ConnectionStatus
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