search for: as_ref

Displaying 2 results from an estimated 2 matches for "as_ref".

Did you mean: is_ref
2024 May 30
0
[RFC PATCH 7/8] rust: add firmware abstractions
...ce count. > + pub unsafe fn from_raw(ptr: *mut bindings::device) -> ARef<Self> { > > + /// Callers must ensure that `ptr` is valid, non-null, and has a non-zero reference count for > + /// the entire duration when the returned reference exists. > + pub unsafe fn as_ref<'a>(ptr: *mut bindings::device) -> &'a Self { > + // SAFETY: Guaranteed by the safety requirements of the function. > + unsafe { &*ptr.cast() } > + } >
2023 Apr 05
3
[PATCH v2 0/2] rust: virtio: add virtio support
This used to be a single patch, but I split it into two with the addition of struct Scatterlist. Again a bit new with Rust submissions. I was told by Gary Guo to rebase on top of rust-next, but it seems *very* behind? The first patch does not build on its own due to a dead_code warning. It is hard to not have dead code when one is adding infrastructure to be used by others at a later