substrate_stellar_sdk/utils/std.rs
1use crate::lib::String;
2
3/// A trait used to convert any Stellar specific type `T` as a String
4/// This also immediately converts the standard Error to a user-defined Error `E`
5/// Helpful for functions that will accept:
6/// * the Stellar type itself;
7/// * encoded &str version of the Stellar type;
8/// * a `Vec<u8>` version of th Stellar type
9pub trait StellarTypeToString<T, E: From<sp_std::str::Utf8Error>> {
10 fn as_encoded_string(&self) -> Result<String, E>;
11}