Re: [PATCH 3/7] rust: debugfs: support for binary large objects
From: Danilo Krummrich
Date: Sun Oct 19 2025 - 08:01:09 EST
On Sun Oct 19, 2025 at 11:44 AM CEST, Alice Ryhl wrote:
> On Fri, Oct 17, 2025 at 04:53:09PM +0200, Danilo Krummrich wrote:
>> On Fri Oct 17, 2025 at 4:37 PM CEST, Danilo Krummrich wrote:
>> > The reason I went with a trait is because that's consistent within the file.
>> >
>> > Otherwise, I don't mind one or the other. If we always want to use a struct, I'm
>> > fine with that. :)
>>
>> Actually, there's another reason I forgot about since I sent the series. :)
>>
>> We need it because we derive it from blanket implementations:
>>
>> impl<T: BinaryWriter + Sync> BinaryReadFile<T> for T
>> impl<T: BinaryReader + Sync> BinaryWriteFile<T> for T
>> impl<T: BinaryWriter + BinaryReader + Sync> BinaryReadWriteFile<T> for T
>
> You can still use a struct:
>
> struct BinaryWriterVtable<T: BinaryWriter + Sync>;
>
> impl<T: BinaryWriter + Sync> BinaryWriterVtable<T> {
> const VTABLE: bindings::foo = ...;
> }
Yeah, but do we get something for adding yet another type in this case?
Another point to consider is if we want a more generic fops abstraction type.
In any case, I'd like to add this as good first issue for the whole file to be
changed accordingly.