Struct substreams::Hex
source · pub struct Hex<T>(pub T);
Expand description
Hex is a simple wrapper type that you can use to wrap your type so that it prints in lower hexadecimal format when use as a formatting argument.
§Examples
use substreams::Hex;
println!("Got an hex value {}", Hex(&[0xabu8, 0xcdu8, 0xefu8]));
It can also be used directly to encode your type as a lower hexadecimal
String
:
§Examples
use substreams::Hex;
let encode = Hex::encode(&[0xabu8, 0xcdu8, 0xefu8]);
Tuple Fields§
§0: T
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Hex<T>where
T: Freeze,
impl<T> RefUnwindSafe for Hex<T>where
T: RefUnwindSafe,
impl<T> Send for Hex<T>where
T: Send,
impl<T> Sync for Hex<T>where
T: Sync,
impl<T> Unpin for Hex<T>where
T: Unpin,
impl<T> UnwindSafe for Hex<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more