pub struct DongleStatus {
pub pd_state: PdState,
pub target_attached: bool,
pub polarity_cc2: bool,
/* private fields */
}Expand description
A live status snapshot read from the dongle.
Fields§
§pd_state: PdStateThe dongle’s PD state machine position.
target_attached: boolWhether a target Mac is currently attached to the dongle’s USB-C port.
polarity_cc2: boolCable orientation: true = CC2 (flipped), false = CC1 (normal).
Implementations§
Source§impl DongleStatus
impl DongleStatus
Sourcepub fn target_ready(&self) -> bool
pub fn target_ready(&self) -> bool
Whether a target Mac is attached and the dongle can act on it, without the caller having to reason about the PD state machine.
Trait Implementations§
Source§impl Clone for DongleStatus
impl Clone for DongleStatus
Source§fn clone(&self) -> DongleStatus
fn clone(&self) -> DongleStatus
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 moreSource§impl Debug for DongleStatus
impl Debug for DongleStatus
Auto Trait Implementations§
impl Freeze for DongleStatus
impl RefUnwindSafe for DongleStatus
impl Send for DongleStatus
impl Sync for DongleStatus
impl Unpin for DongleStatus
impl UnsafeUnpin for DongleStatus
impl UnwindSafe for DongleStatus
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