Skip to main content

JavaHash

Trait JavaHash 

Source
pub trait JavaHash {
    // Required method
    fn java_hash(&self, hash_type: HashType) -> i64;
}
Expand description

Rust analogue of G.hashFn(t).apply(o): the Java long hash of a value under the given hash type. Implemented for Value in core.rs and for the plain Java-like primitives here. Collection element types in lang::data hash through this trait so the HashType dispatches all the way down nested structures.

Required Methods§

Source

fn java_hash(&self, hash_type: HashType) -> i64

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl JavaHash for &str

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for String

Plain strings hash identically under every hash type: G.hashFn(t) only dispatches on IHash objects, everything else takes hashValue, which for a Java String is String.hashCode.

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for bool

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for char

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for f64

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for i32

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for i64

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for u64

Source§

fn java_hash(&self, _: HashType) -> i64

Source§

impl JavaHash for usize

Source§

fn java_hash(&self, _: HashType) -> i64

Implementors§