pub struct ConsoleDevice {
avail_features: u64,
pub(crate) ports: Vec<ConsolePort>,
worker: Option<WorkerHandle>,
}
Fields§
§avail_features: u64
§ports: Vec<ConsolePort>
§worker: Option<WorkerHandle>
Implementations§
source§impl ConsoleDevice
impl ConsoleDevice
sourcepub fn new_single_port(
protection_type: ProtectionType,
port: ConsolePort,
) -> ConsoleDevice
pub fn new_single_port( protection_type: ProtectionType, port: ConsolePort, ) -> ConsoleDevice
Create a console device that does not support the multiport feature.
sourcepub fn new_multi_port(
protection_type: ProtectionType,
ports: Vec<ConsolePort>,
) -> ConsoleDevice
pub fn new_multi_port( protection_type: ProtectionType, ports: Vec<ConsolePort>, ) -> ConsoleDevice
Create a console device with the multiport feature enabled.
pub fn features(&self) -> u64
pub fn max_ports(&self) -> usize
sourcepub fn max_queues(&self) -> usize
pub fn max_queues(&self) -> usize
Returns the maximum number of queues supported by this device.
pub fn read_config(&self, offset: u64, data: &mut [u8])
pub fn keep_rds(&self) -> Vec<RawDescriptor>
fn ensure_worker_started(&mut self) -> &mut WorkerHandle
fn ensure_worker_stopped(&mut self)
pub fn start_queue(&mut self, idx: usize, queue: Queue) -> Result<()>
pub fn stop_queue(&mut self, idx: usize) -> Result<Option<Queue>>
pub fn reset(&mut self) -> Result<()>
pub fn start_input_threads(&mut self)
pub fn stop_input_threads(&mut self)
pub fn snapshot(&mut self) -> Result<ConsoleSnapshot>
pub fn restore(&mut self, snap: &ConsoleSnapshot) -> Result<()>
Trait Implementations§
source§impl SerialDevice for ConsoleDevice
impl SerialDevice for ConsoleDevice
fn new( protection_type: ProtectionType, _event: Event, input: Option<Box<dyn SerialInput>>, output: Option<Box<dyn Write + Send>>, _sync: Option<Box<dyn FileSync + Send>>, options: SerialOptions, keep_rds: Vec<RawDescriptor>, ) -> ConsoleDevice
Auto Trait Implementations§
impl Freeze for ConsoleDevice
impl !RefUnwindSafe for ConsoleDevice
impl Send for ConsoleDevice
impl !Sync for ConsoleDevice
impl Unpin for ConsoleDevice
impl !UnwindSafe for ConsoleDevice
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
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.