Re: [PATCH v8 4/6] rust: debugfs: Support arbitrary owned backing for File
From: Danilo Krummrich
Date: Mon Jun 30 2025 - 13:30:25 EST
On 6/28/25 1:18 AM, Matthew Maurer wrote:
+ fn create_file<D: ForeignOwnable>(&self, _name: &CStr, data: D) -> File
+ where
+ for<'a> D::Borrowed<'a>: Display,
+ {
+ File {
+ _foreign: ForeignHolder::new(data),
+ }
}
What's the motivation for the ForeignHolder abstraction? Why not just make it
File<D> and store data directly?