pub trait Hash: Any + Debug + LowerHex + UpperHex {
fn hash_type(&self) -> &'static dyn HashType
where
Self: Sized;
fn as_slice(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
;
}
Required Methods
fn hash_type(&self) -> &'static dyn HashTypewhere
Self: Sized,
fn as_slice(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Implementations
sourceimpl dyn Hash
impl dyn Hash
sourcepub fn downcast_ref<T: Hash>(&self) -> Option<&T>
pub fn downcast_ref<T: Hash>(&self) -> Option<&T>
Returns some reference to the boxed value if it is of type T
, or
None
if it isn’t.
sourcepub unsafe fn downcast_ref_unchecked<T: Hash>(&self) -> &T
pub unsafe fn downcast_ref_unchecked<T: Hash>(&self) -> &T
Returns a reference to the boxed value, blindly assuming it to be of type T
.
If you are not absolutely certain of T
, you must not call this.
sourcepub fn downcast_mut<T: Hash>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Hash>(&mut self) -> Option<&mut T>
Returns some mutable reference to the boxed value if it is of type T
, or
None
if it isn’t.
sourcepub unsafe fn downcast_mut_unchecked<T: Hash>(&mut self) -> &mut T
pub unsafe fn downcast_mut_unchecked<T: Hash>(&mut self) -> &mut T
Returns a mutable reference to the boxed value, blindly assuming it to be of type T
.
If you are not absolutely certain of T
, you must not call this.
sourceimpl dyn Hash
impl dyn Hash
sourcepub fn downcast<T: Hash>(self: Box<Self>) -> Result<Box<T>, Box<Self>>
pub fn downcast<T: Hash>(self: Box<Self>) -> Result<Box<T>, Box<Self>>
Returns the boxed value if it is of type T
, or Err(Self)
if it isn’t.
sourcepub unsafe fn downcast_unchecked<T: Hash>(self: Box<Self>) -> Box<T>
pub unsafe fn downcast_unchecked<T: Hash>(self: Box<Self>) -> Box<T>
Returns the boxed value, blindly assuming it to be of type T
.
If you are not absolutely certain of T
, you must not call this.