Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arcref

A smart pointer type that can wrap either a &'static T or an Arc<T>.

Equality

ArcRef<T> implements PartialEq by checking pointer identity first. If two ArcRefs point at the same backing allocation or the same &'static reference, they compare equal without calling T's PartialEq implementation. Otherwise, equality falls back to comparing the dereferenced values.

This means cloned ArcRefs are always equal to each other, and equality remains reflexive even for wrapped types whose PartialEq is not, such as f64::NAN.

See the examples/ folder for example usage.

About

🦀 &'static T | Arc<T>

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages