async_fuser/ll/reply_async/
lookup.rs1#![allow(missing_docs, missing_debug_implementations)]
5
6use std::time::Duration;
7
8use crate::FileAttr;
9use crate::Generation;
10use crate::ll::ResponseStruct;
11use crate::ll::ioslice_concat::IosliceConcat;
12use crate::ll::reply::Attr;
13use crate::ll::reply::Response;
14
15#[derive(Debug)]
17pub struct LookupResponse {
18 ttl: Duration,
19 attr: FileAttr,
20 generation: Generation,
21}
22
23impl LookupResponse {
24 pub fn new(ttl: Duration, attr: FileAttr, generation: Generation) -> Self {
28 Self {
29 ttl,
30 attr,
31 generation,
32 }
33 }
34}
35
36impl Response for LookupResponse {
37 fn payload(&self) -> impl IosliceConcat {
38 ResponseStruct::new_entry(
39 self.attr.ino,
40 self.generation,
41 &Attr::from(self.attr),
42 self.ttl,
43 self.ttl,
44 )
45 }
46}