osom_lib_test_macros/traits/
as_display_as_hex.rs1use crate::models::DisplayAsHex;
2
3pub trait AsDisplayAsHex {
4 fn as_display_as_hex(&self) -> DisplayAsHex<'_>;
5}
6
7impl AsDisplayAsHex for &[u8] {
8 fn as_display_as_hex(&self) -> DisplayAsHex<'_> {
9 DisplayAsHex::new(self)
10 }
11}
12
13impl AsDisplayAsHex for [u8] {
14 fn as_display_as_hex(&self) -> DisplayAsHex<'_> {
15 DisplayAsHex::new(self)
16 }
17}
18
19impl<const N: usize> AsDisplayAsHex for [u8; N] {
20 fn as_display_as_hex(&self) -> DisplayAsHex<'_> {
21 DisplayAsHex::new(self)
22 }
23}
24
25impl<const N: usize> AsDisplayAsHex for &[u8; N] {
26 fn as_display_as_hex(&self) -> DisplayAsHex<'_> {
27 DisplayAsHex::new(*self)
28 }
29}
30
31impl AsDisplayAsHex for Vec<u8> {
32 fn as_display_as_hex(&self) -> DisplayAsHex<'_> {
33 DisplayAsHex::new(self)
34 }
35}
36
37impl AsDisplayAsHex for &Vec<u8> {
38 fn as_display_as_hex(&self) -> DisplayAsHex<'_> {
39 DisplayAsHex::new(self)
40 }
41}