On Tue, Nov 17, 2026 at 08:40:20PM +0100, Danilo Krummrich wrote:
> > +    /// Access the driver-private [`VaData`](DriverGpuVm::VaData) 
> > associated with this mapping.
> > +    #[inline]
> > +    pub fn data_ref(&self) -> &T::VaData {
> > +        &self.data
> > +    }
> > +
> Why data_ref() instead of just data() or a Deref impl?

I guess this came from mirroring UniqueRefGpuVm, which uses the names:
data_ref(&self) and data(&mut self).

I think it makes more sense to rename to data(&self)/data_mut(&mut self)
for consistency with other similar APIs. But we should also update
UniqueRefGpuVm if so.

We don't want to go the Deref/DerefMut route because mutable access needs
to return a `Pin<&mut GpuVa<T>>` which doesn't work with DerefMut.

Alice

Reply via email to