Re: [PATCH v13 1/3] rust: io: add resource abstraction

From: Danilo Krummrich
Date: Wed Jul 16 2025 - 13:11:23 EST


On Wed Jul 16, 2025 at 6:52 PM CEST, Daniel Almeida wrote:
> I guess the easiest solution is to drop 'static in order to account for the
> above, and change the signature to return Option<&CStr> instead.

I think you have to do both, this...

> We can also change Region to own the name, and pass name by value here:

...and this.

Otherwise you'd need to ensure that the Resource you create the Region from
out-lives the Region, which I think we can't.

> pub fn request_region(
> &self,
> start: ResourceSize,
> size: ResourceSize,
> name: &'static CStr <------
>
>
> Thoughts?
>
> — Daniel