Rust-for-Linux / linux

Adding support for the Rust language to the Linux kernel.
https://rust-for-linux.com
Other
3.99k stars 430 forks source link

Add more examples to `Either` #1122

Open ojeda opened 1 month ago

ojeda commented 1 month ago

Add more examples to Either.

For instance, it would be nice to add a "real-life" example similar to Wedson's example on the filesystem abstractions' get_or_crate_inode proposal from his talk at LSF/MM/BPF 2024, i.e. something like:

fn get_or_create_inode(&self, ino: Ino) -> Result<Either<ARef<INode<T>>, inode::New<T>>>

See https://rust-for-linux.zulipchat.com/#narrow/stream/291565-Help/topic/What.20to.20work.20on.20next.3F/near/467478085.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag and a Link: tag to this issue. Please see https://rust-for-linux.com/contributing for details.

Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.

Timgrau commented 1 month ago

Hey @ojeda, im working on this.

ojeda commented 1 month ago

Thanks for letting me know @Timgrau, that is great.