mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Change block device trait
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
5b274d6cbe
commit
1616f2d32c
@ -530,6 +530,11 @@ impl<'a> VmReader<'a> {
|
||||
unsafe { self.end.sub_ptr(self.cursor) }
|
||||
}
|
||||
|
||||
/// Returns the cursor pointer, which refers to the address of the next byte to read.
|
||||
pub const fn cursor(&self) -> *const u8 {
|
||||
self.cursor
|
||||
}
|
||||
|
||||
/// Returns if it has remaining data to read.
|
||||
pub const fn has_remain(&self) -> bool {
|
||||
self.remain() > 0
|
||||
@ -635,6 +640,11 @@ impl<'a> VmWriter<'a> {
|
||||
unsafe { self.end.sub_ptr(self.cursor) }
|
||||
}
|
||||
|
||||
/// Returns the cursor pointer, which refers to the address of the next byte to write.
|
||||
pub const fn cursor(&self) -> *mut u8 {
|
||||
self.cursor
|
||||
}
|
||||
|
||||
/// Returns if it has avaliable space to write.
|
||||
pub const fn has_avail(&self) -> bool {
|
||||
self.avail() > 0
|
||||
|
Reference in New Issue
Block a user