rune_core/hash/
into_hash.rsuse crate::hash::Hash;
use crate::protocol::Protocol;
mod sealed {
use crate::hash::Hash;
use crate::params::Params;
use crate::protocol::Protocol;
pub trait Sealed {}
impl Sealed for &str {}
impl Sealed for Hash {}
impl Sealed for &Protocol {}
impl<T, const N: usize> Sealed for Params<T, N> {}
}
pub trait IntoHash: self::sealed::Sealed {
fn into_hash(self) -> Hash;
}
impl IntoHash for Hash {
#[inline]
fn into_hash(self) -> Hash {
self
}
}
impl IntoHash for &str {
#[inline]
fn into_hash(self) -> Hash {
Hash::ident(self)
}
}
impl IntoHash for &Protocol {
#[inline]
fn into_hash(self) -> Hash {
self.hash
}
}