agglayer_primitives/utils.rs
1use crate::{digest::Digest, U256};
2
3/// Allows for the conversion of a boolean to a type
4/// This trait is used in tree to properly bound the type of the digest.
5pub trait FromBool {
6 fn from_bool(b: bool) -> Self;
7}
8
9pub trait FromU256 {
10 fn from_u256(u: U256) -> Self;
11}
12
13/// Trait for objects that can be hashed.
14pub trait Hashable {
15 /// Hashes the object to a [`Digest`].
16 fn hash(&self) -> Digest;
17}