Skip to main content

Request

Trait Request 

Source
pub trait Request<'a>: Sized {
    type Buffer;
    type Options;

    // Required methods
    fn options(flags: Open, mode: Mode) -> Self::Options;
    fn open(
        dir: BorrowedFd<'a>,
        path: &'a CStr,
        options: &'a Self::Options,
    ) -> Self;
    fn write(file: BorrowedFd<'a>, input: Self::Buffer, offset: Offset) -> Self;
    fn write_current(file: BorrowedFd<'a>, input: Self::Buffer) -> Self;
    fn sync(file: BorrowedFd<'a>, mode: Sync) -> Self;
    fn rename(dir: BorrowedFd<'a>, old: &'a CStr, new: &'a CStr) -> Self;
    fn unlink(dir: BorrowedFd<'a>, name: &'a CStr) -> Self;
}
Expand description

File requests retaining their descriptor, path, options, and input borrows.

Required Associated Types§

Required Methods§

Source

fn options(flags: Open, mode: Mode) -> Self::Options

Source

fn open(dir: BorrowedFd<'a>, path: &'a CStr, options: &'a Self::Options) -> Self

Source

fn write(file: BorrowedFd<'a>, input: Self::Buffer, offset: Offset) -> Self

Source

fn write_current(file: BorrowedFd<'a>, input: Self::Buffer) -> Self

Writes at the owned descriptor’s current position, honoring O_APPEND.

Source

fn sync(file: BorrowedFd<'a>, mode: Sync) -> Self

Source

fn rename(dir: BorrowedFd<'a>, old: &'a CStr, new: &'a CStr) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§