Skip to main content

RHash

Trait RHash 

Source
pub trait RHash {
    // Required method
    fn hash(&self) -> i64;
}
Expand description

Adapter trait for std::hash::Hash.

Provides hashing for deduplication and environment keys in R. Automatically implemented for any type that implements Hash.

§Methods

  • hash() - Returns a 64-bit hash as i64

§Note

Hash values are deterministic within a single R session but may vary between sessions due to Rust’s hasher implementation.

§Example

#[derive(Hash, ExternalPtr)]
struct Record { id: String, value: i64 }

#[miniextendr]
impl RHash for Record {}

Required Methods§

Source

fn hash(&self) -> i64

Compute a hash of this value.

Implementors§

Source§

impl<T: Hash> RHash for T