#![allow(missing_docs, missing_debug_implementations)]
use std::time::Duration;
use crate::FileAttr;
use crate::Generation;
use crate::ll::ResponseStruct;
use crate::ll::ioslice_concat::IosliceConcat;
use crate::ll::reply::Attr;
use crate::ll::reply::Response;
#[derive(Debug)]
pub struct LookupResponse {
ttl: Duration,
attr: FileAttr,
generation: Generation,
}
impl LookupResponse {
pub fn new(ttl: Duration, attr: FileAttr, generation: Generation) -> Self {
Self {
ttl,
attr,
generation,
}
}
}
impl Response for LookupResponse {
fn payload(&self) -> impl IosliceConcat {
ResponseStruct::new_entry(
self.attr.ino,
self.generation,
&Attr::from(self.attr),
self.ttl,
self.ttl,
)
}
}