Skip to main content

IntoHashable

Trait IntoHashable 

Source
pub trait IntoHashable<'a> {
    // Required method
    fn into_hashable(self) -> HashableValue<'a>;
}
Expand description

Anything that can stand where SwiftUI wants some Hashable.

So that .id(7) and .id("row") are what a caller writes, rather than .id(HashableValue::Int(7)). The enum stays as the carrier — it is what crosses into the unsafe code — and this is the conversion into it.

Implemented per Rust type rather than blanket over Hash: the value has to cross into Swift, so it needs a Swift type with a Hashable conformance to cross as, and that mapping is a decision per type rather than something derivable.

Required Methods§

Source

fn into_hashable(self) -> HashableValue<'a>

This value as the carrier.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IntoHashable<'_> for bool

Source§

impl IntoHashable<'_> for f64

Source§

impl IntoHashable<'_> for i32

Source§

impl IntoHashable<'_> for i64

Source§

impl IntoHashable<'_> for usize

Source§

impl<'a> IntoHashable<'a> for &'a String

Source§

impl<'a> IntoHashable<'a> for &'a str

Implementors§

Source§

impl<'a> IntoHashable<'a> for HashableValue<'a>