[−][src]Struct agilulf_fs::File
A struct contains only one fd.
As the constant style of Linux system call, aio accepts fd. And I cannot get a fd from std::fs::File
.
pub struct File { fd: RawFd, }
WARNING
-
This struct will close the fd automatically when it's dropped.
-
Open file with this struct will take over the SIGIO signal. AIO will send a SIGIO signal with request id to this process and then this library will lookup
WAKER_LIST
and find the waker corresponding to this id. Then it will wake that task.
Methods
impl File
[src]
pub fn open(path: &str) -> Result<Self>
[src]
Open file from given path.
The oflag in this function is set as O_RDWR | O_CREAT
. And the mode is set as S_IRUSR|S_IWUSR
.
While opening the first file, it will take over the SIGIO signal (by set it's handler).
ⓘImportant traits for WriteFile<'a>pub fn write<'a>(&self, offset: i64, buf: &'a [u8]) -> WriteFile<'a>
[src]
Write buffer into file with aio.
pub fn fallocate(&self, offset: i64, len: i64) -> Result<()>
[src]
fallocate the file.
Trait Implementations
Auto Trait Implementations
impl Send for File
impl Unpin for File
impl Sync for File
impl UnwindSafe for File
impl RefUnwindSafe for File
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,