Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kixunil/same
Tools for testing identity of objects in Rust
https://github.com/kixunil/same
Last synced: 3 months ago
JSON representation
Tools for testing identity of objects in Rust
- Host: GitHub
- URL: https://github.com/kixunil/same
- Owner: Kixunil
- Created: 2018-08-04T18:56:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-06T07:27:13.000Z (over 6 years ago)
- Last Synced: 2024-10-08T18:14:36.766Z (3 months ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Same
====A crate for comparing references in generic way.
About
-----This crate provides mainly the trait `Same` which can be used on *shared*
reference types. (`&T`, `Rc`, `Arc`). It enables the users to test identity
of objects. It's analogous to `PartialEq`, which tests *equality* instead.Additionally, this crate provides `RefHash` trait, which is used for hashing
references and `RefCmp` wrapper struct, which implements `Eq`, `PartialEq`
and `Hash` by delegating to `Same` and `RefHash` traits. This is mainly
useful if one wants to store objects in `HashSet` or similar data structure,
with.This crate is `no_std`-compatible.
License
-------MITNFA