use alloc::boxed::Box;
use crate::prelude::*;
#[cfg(feature = "net")]
pub type AxNetDevice = Box<dyn NetDriverOps>;
#[cfg(feature = "block")]
pub type AxBlockDevice = Box<dyn BlockDriverOps>;
#[cfg(feature = "display")]
pub type AxDisplayDevice = Box<dyn DisplayDriverOps>;
#[cfg(feature = "input")]
pub type AxInputDevice = Box<dyn InputDriverOps>;
#[cfg(feature = "vsock")]
pub type AxVsockDevice = Box<dyn VsockDriverOps>;
impl super::AxDeviceEnum {
#[cfg(feature = "net")]
pub fn from_net(dev: impl NetDriverOps + 'static) -> Self {
Self::Net(Box::new(dev))
}
#[cfg(feature = "block")]
pub fn from_block(dev: impl BlockDriverOps + 'static) -> Self {
Self::Block(Box::new(dev))
}
#[cfg(feature = "display")]
pub fn from_display(dev: impl DisplayDriverOps + 'static) -> Self {
Self::Display(Box::new(dev))
}
#[cfg(feature = "input")]
pub fn from_input(dev: impl InputDriverOps + 'static) -> Self {
Self::Input(Box::new(dev))
}
#[cfg(feature = "vsock")]
pub fn from_vsock(dev: impl VsockDriverOps + 'static) -> Self {
Self::Vsock(Box::new(dev))
}
}