VirtIOBlkDriver

Struct VirtIOBlkDriver 

Source
pub struct VirtIOBlkDriver(Mutex<VirtIOBlk<VirtIOHal, MmioTransport<'static>>>);
Expand description

VirtIO 块设备驱动结构体

Tuple Fields§

§0: Mutex<VirtIOBlk<VirtIOHal, MmioTransport<'static>>>

Trait Implementations§

Source§

impl BlockDriver for VirtIOBlkDriver

Source§

fn read_block(&self, block_id: usize, buf: &mut [u8]) -> bool

读取块设备数据 Read more
Source§

fn write_block(&self, block_id: usize, buf: &[u8]) -> bool

写入块设备数据 Read more
Source§

fn flush(&self) -> bool

刷新到磁盘 Read more
Source§

fn block_size(&self) -> usize

获取块大小(字节) Read more
Source§

fn total_blocks(&self) -> usize

获取总块数 Read more
Source§

impl Driver for VirtIOBlkDriver

Source§

fn try_handle_interrupt(&self, _irq: Option<usize>) -> bool

Source§

fn device_type(&self) -> DeviceType

Source§

fn get_id(&self) -> String

Source§

fn as_block(&self) -> Option<&dyn BlockDriver>

将驱动程序转换为块设备驱动程序(如果适用)
Source§

fn as_block_arc(self: Arc<Self>) -> Option<Arc<dyn BlockDriver>>

将驱动程序转换为块设备驱动程序 Arc(如果适用)
Source§

fn as_net(&self) -> Option<&dyn NetDevice>

将驱动程序转换为网络驱动程序(如果适用)
Source§

fn as_rtc(&self) -> Option<&dyn RtcDriver>

将驱动程序转换为实时时钟驱动程序(如果适用)
Source§

fn as_net_arc(self: Arc<Self>) -> Option<Arc<dyn NetDevice>>

将驱动程序转换为网络驱动程序 Arc(如果适用)
Source§

fn as_rtc_arc(self: Arc<Self>) -> Option<Arc<dyn RtcDriver>>

将驱动程序转换为实时时钟驱动程序 Arc(如果适用)
Source§

fn as_serial(&self) -> Option<&dyn SerialDriver>

将驱动程序转换为串口驱动程序(如果适用)

Auto Trait Implementations§

§

impl !Freeze for VirtIOBlkDriver

§

impl !RefUnwindSafe for VirtIOBlkDriver

§

impl Send for VirtIOBlkDriver

§

impl Sync for VirtIOBlkDriver

§

impl Unpin for VirtIOBlkDriver

§

impl !UnwindSafe for VirtIOBlkDriver

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.