enum PortState {
Empty(u8),
EmptyNotReady,
Occupied(u8),
OccupiedNotReady,
}
Expand description
PortState indicates the state of the port.
The initial PortState is EmptyNotReady (EmpNR). 9 PortStates are possible, and transition between the states are only possible by the following 3 groups of functions: handle_port_ready(R): guest notification of port ready to accept hot plug events. handle_plug_request(P) and handle_unplug_request(U): host initated requests. handle_plug_complete(PC) and handle_unplug_complete(UC): guest notification of event completion. When a port is not ready, PC and UC are not expected as no events are scheduled. The state transition is as follows: Emp0<-UC–Emp1<-PC–Emp2 | ^ \ ^ ^ ^ ^ | / P / P\ / P\ | | / \ \ | | /\ /\ \ | R U \ U \U \U | | / v / v\ v\ | | Occ0<-PC–Occ1<-UC–Occ2<-PC–Occ3 | | ^ | \ R | EmpNR<-P,U->OccNR |
Variants§
Empty(u8)
Port is empty on crosvm. The state on the guest OS is n steps behind.
EmptyNotReady
Port is empty on crosvm. The port is not enabled on the guest OS yet.
Occupied(u8)
Port is occupied on crosvm. The state on the guest OS is n steps behind.
OccupiedNotReady
Port is occupied on crosvm. The port is not enabled on the guest OS yet.
Implementations§
Trait Implementations§
source§impl Ord for PortState
impl Ord for PortState
Ordering on PortState defined by “most empty”.
source§impl PartialEq for PortState
impl PartialEq for PortState
source§impl PartialOrd for PortState
impl PartialOrd for PortState
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for PortState
impl Eq for PortState
impl StructuralPartialEq for PortState
Auto Trait Implementations§
impl RefUnwindSafe for PortState
impl Send for PortState
impl Sync for PortState
impl Unpin for PortState
impl UnwindSafe for PortState
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.