pub trait ToOutput {
// Required method
fn to_output(&self, output: &mut impl Output);
// Provided methods
fn data_hash(&self) -> Hash { ... }
fn mangle_hash(&self) -> Hash { ... }
fn output<T: Output + Default>(&self) -> T { ... }
fn vec(&self) -> Vec<u8> ⓘ { ... }
}Expand description
Values of this type can be uniquely represented as a Vec<u8>.
Required Methods§
Provided Methods§
fn data_hash(&self) -> Hash
fn mangle_hash(&self) -> Hash
fn output<T: Output + Default>(&self) -> T
Sourcefn vec(&self) -> Vec<u8> ⓘ
fn vec(&self) -> Vec<u8> ⓘ
Examples found in repository?
examples/derive.rs (line 101)
94fn main() {
95 println!("{}", hex::encode(DeriveExample::<(), ()>::HASH));
96 println!("{}", DeriveExample::<Be<u8>, Le<u8>>::SIZE);
97 println!("{}", Test::<(), (), ()>::SIZE);
98 println!("{}", Option::<Test<(), (), ()>>::SIZE);
99 println!("{}", Option::<Stuff<()>>::SIZE);
100 println!("{}", Option::<Stuff<bool>>::SIZE);
101 println!("{:?}", None::<Stuff<(bool, ())>>.vec());
102 println!("{}", Option::<Either<bool, Option<Option<()>>>>::SIZE);
103 println!("{:?}", None::<Abc>.vec());
104 println!("{:?}", None::<(bool, bool)>.vec());
105 Option::<Abc>::parse_slice_refless(&[1, 2]).unwrap();
106}Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: InlineOutput, J: InlineOutput, K: InlineOutput, L: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: InlineOutput, J: InlineOutput, K: InlineOutput, L: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I, J, K, L)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: InlineOutput, J: InlineOutput, K: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: InlineOutput, J: InlineOutput, K: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I, J, K)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: InlineOutput, J: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I, J)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: InlineOutput, J: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I, J)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: InlineOutput, I: ToOutput> ToOutput for (A, B, C, D, E, F, G, H, I)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: ToOutput> ToOutput for (A, B, C, D, E, F, G, H)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: InlineOutput, H: ToOutput> ToOutput for (A, B, C, D, E, F, G, H)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: ToOutput> ToOutput for (A, B, C, D, E, F, G)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: InlineOutput, G: ToOutput> ToOutput for (A, B, C, D, E, F, G)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: ToOutput> ToOutput for (A, B, C, D, E, F)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: ToOutput> ToOutput for (A, B, C, D, E, F)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: ToOutput> ToOutput for (A, B, C, D, E)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: ToOutput> ToOutput for (A, B, C, D, E)
Source§impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: ToOutput> ToOutput for (A, B, C, D)
impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: ToOutput> ToOutput for (A, B, C, D)
Source§impl<A: InlineOutput, B: InlineOutput, C: ToOutput> ToOutput for (A, B, C)
impl<A: InlineOutput, B: InlineOutput, C: ToOutput> ToOutput for (A, B, C)
Source§impl<K: InlineOutput, V: InlineOutput> ToOutput for BTreeMap<K, V>
impl<K: InlineOutput, V: InlineOutput> ToOutput for BTreeMap<K, V>
Source§impl<T: InlineOutput, N: ArrayLength> ToOutput for GenericArray<T, N>
impl<T: InlineOutput, N: ArrayLength> ToOutput for GenericArray<T, N>
Source§impl<T: InlineOutput> ToOutput for BTreeSet<T>
impl<T: InlineOutput> ToOutput for BTreeSet<T>
Source§impl<T: InlineOutput> ToOutput for Vec<T>
impl<T: InlineOutput> ToOutput for Vec<T>
Source§impl<T: InlineOutput> ToOutput for VecDeque<T>
impl<T: InlineOutput> ToOutput for VecDeque<T>
Source§impl<const S: usize> ToOutput for CidGeneric<S>
Available on crate feature cid only.
impl<const S: usize> ToOutput for CidGeneric<S>
Available on crate feature
cid only.