-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore interior mutability #79
Comments
So one issue here is stopping people opening the same volume twice, but allowing all the objects to be stashed in a struct for later use (so they can't refer to each other). Perhaps the VolumeManager can hold all the volumes internally and lend out &mut Volume references cheaply, but only for one Volume at a time. You could even const generic the number of Volumes a VolumeManager can hold (one is usually fine, but sometimes there's an EFI partition first or something). Then I think for opening files you can either get a File (which holds a &Volume) or a RawFile (which does not, but does hold some unique ID for the Volume so it'll panic if you use it with the wrong Volume in future). |
Looked at this in #103 is a start on this, but using Also there's an old branch: https://github.com/rust-embedded-community/embedded-sdmmc-rs/tree/make_api_immutable |
Closed by #143 |
Now that
critical-section
is a thing, maybe we can consider interior mutability:Volume
can hold an&VolumeManager
Directory
andFile
can hold an&Volume
The text was updated successfully, but these errors were encountered: