wnfs-wg / rs-wnfs

Rust implementation of the WebNative FileSystem (WNFS) specification
https://github.com/wnfs-wg
Apache License 2.0
145 stars 23 forks source link

Immutable Core #23

Closed expede closed 2 years ago

expede commented 2 years ago

Port of https://github.com/fission-suite/webnative/issues/301


Make the internals run on an immutable core


Linking

matheus23 commented 2 years ago

This is done! :)

All operations are defined on Rc<PublicDirectory> (i.e. owned reference counted smart pointers on immutable data) and the data itself doesn't contain any RefCells:

https://github.com/WebNativeFileSystem/rs-wnfs/blob/4170b8e86058a02ca3a8a713b53b842d2b08afc5/crates/fs/public/directory.rs#L41-L46

https://github.com/WebNativeFileSystem/rs-wnfs/blob/4170b8e86058a02ca3a8a713b53b842d2b08afc5/crates/fs/public/link.rs#L14-L18

https://github.com/WebNativeFileSystem/rs-wnfs/blob/4170b8e86058a02ca3a8a713b53b842d2b08afc5/crates/fs/public/node.rs#L17-L21