8000 GitHub - hazelwiss/maybe_null: A Rust library for MaybeNull pointer type.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hazelwiss/maybe_null

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaybeNull

The MaybeNull type is used for hinting that a pointer may be null, and still prevent accidental null pointer dereference.

use maybe_null::MaybeNull;

let ptr = MaybeNull::<u32>::null();

let Some(ptr) = ptr.get() {
  // We know the pointer is non-null here.

  // Whoops! this will never happen because our `ptr` was initialized as null!
  ptr.write(0);
}

AtomicMaybeNull

The AtomicMaybeNull works like MaybeNull but allows for atomic access of the pointer.

About

A Rust library for MaybeNull pointer type.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0