dope_sys/io/request/
mod.rs1mod borrow;
2mod complete;
3mod context;
4mod datagram;
5mod execute;
6mod lower;
7mod source;
8
9use std::os::fd;
10
11use o3::buffer::bytes::bounded;
12
13pub use borrow::Borrow;
14pub use complete::Complete;
15pub use context::Context;
16pub use datagram::Datagram;
17pub use execute::Execute;
18pub use lower::Lower;
19pub use source::Source;
20
21use crate::io::file;
22
23pub trait Request<'a>: Sized {
25 type Buffer;
26 type Options;
27
28 fn options(flags: file::Open, mode: file::Mode) -> Self::Options;
29 fn open(dir: fd::BorrowedFd<'a>, path: &'a std::ffi::CStr, options: &'a Self::Options) -> Self;
30 fn read(
31 file: fd::BorrowedFd<'a>,
32 output: bounded::Value<&'a mut [u8]>,
33 offset: file::Offset,
34 ) -> Self;
35 fn write(file: fd::BorrowedFd<'a>, input: Self::Buffer, offset: file::Offset) -> Self;
36 fn write_current(file: fd::BorrowedFd<'a>, input: Self::Buffer) -> Self;
38 fn sync(file: fd::BorrowedFd<'a>, mode: file::Sync) -> Self;
39 fn rename(dir: fd::BorrowedFd<'a>, old: &'a std::ffi::CStr, new: &'a std::ffi::CStr) -> Self;
40 fn unlink(dir: fd::BorrowedFd<'a>, name: &'a std::ffi::CStr) -> Self;
41}