cw_address_like/
lib.rs

1#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
2
3use std::{
4    fmt::{Debug, Display},
5    hash::Hash,
6};
7
8/// Marks either `String` or `cosmwasm_std::Addr`.
9///
10/// String is used in unverified types, such as messages and query responses.
11/// Addr is used in verified types, which are to be stored in blockchain state.
12///
13/// This trait is intended to be used as a generic in type definitions.
14pub trait AddressLike: Clone + Debug + Display + PartialEq + Eq + PartialOrd + Ord + Hash {}
15
16impl AddressLike for String {}
17impl AddressLike for cosmwasm_std::Addr {}