You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have been following the 'Writing an OS in Rust' guide. And while I was experimenting and reading through the code I noticed that Copy hasn't been implemented for Volatile.
This could be useful when writing code:
impl<T:Copy>CopyforVolatile<T>{// Empty.}
After this the new line function for the VGA buffer can be implemented as follows:
I think it should be possible to implement VolatileArray and VolatileSlice types now that we have basic support for const generics in Rust, but I'm not 100% sure.
Activity
videah commentedon Nov 8, 2019
See #6 (comment) and #5 (comment) as to why this hasn't been done yet.
I would like to see VolatileArray be implemented, is that possible now? @phil-opp
BuggStream commentedon Nov 9, 2019
Oh it seems like I forgot to look at the MRs to check if this was already asked. Sorry about that. Anyway thanks for your answer.
I'd also be interested to know if something like VolatileArray could be useful.
phil-opp commentedon Nov 26, 2019
I think it should be possible to implement
VolatileArrayandVolatileSlicetypes now that we have basic support for const generics in Rust, but I'm not 100% sure.phil-opp commentedon Jun 24, 2023
The new v0.5.0 release includes both a
VolatilePtrtype that implementsCopyand (unstable) methods for accessing slices and arrays.