Skip to main content

async_fuser/ll/reply_async/
open.rs

1//! Response data implementation of async open-style operations.
2
3use crate::FopenFlags;
4use crate::ll::FileHandle;
5use crate::ll::ResponseStruct;
6use crate::ll::ioslice_concat::IosliceConcat;
7use crate::ll::reply::Response;
8
9/// Response data from async open-style operations.
10#[derive(Debug)]
11pub struct OpenResponse {
12    fh: FileHandle,
13    flags: FopenFlags,
14}
15
16impl OpenResponse {
17    /// Creates a new [`OpenResponse`].
18    pub fn new(fh: FileHandle, flags: FopenFlags) -> Self {
19        Self { fh, flags }
20    }
21}
22
23impl Response for OpenResponse {
24    fn payload(&self) -> impl IosliceConcat {
25        ResponseStruct::new_open(self.fh, self.flags, 0)
26    }
27}