Skip to main content

ToOutput

Trait ToOutput 

Source
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§

Source

fn to_output(&self, output: &mut impl Output)

Provided Methods§

Source

fn data_hash(&self) -> Hash

Source

fn mangle_hash(&self) -> Hash

Source

fn output<T: Output + Default>(&self) -> T

Source

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 ToOutput for ()

Source§

fn to_output(&self, _: &mut impl Output)

Source§

impl ToOutput for Bytes

Available on crate feature bytes only.
Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for BytesMut

Available on crate feature bytes only.
Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for CStr

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for CString

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for Infallible

Source§

fn to_output(&self, _: &mut impl Output)

Source§

impl ToOutput for NonZero<i8>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<i16>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<i32>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<i64>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<i128>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<u8>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<u16>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<u32>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<u64>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for NonZero<u128>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for Ordering

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for String

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for Ulid

Available on crate feature ulid only.
Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for bool

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for char

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for f32

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for f64

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for i8

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for i16

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for i32

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for i64

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for i128

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for str

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for u8

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for u16

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for u32

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for u64

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl ToOutput for u128

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<'a, B: 'a + ToOwned + ToOutput + ?Sized> ToOutput for Cow<'a, B>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<A, O: BitOrder> ToOutput for BitArray<A, O>

Available on crate feature bitvec only.
Source§

fn to_output(&self, output: &mut impl Output)

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)

Source§

fn to_output(&self, output: &mut impl Output)

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)

Source§

fn to_output(&self, output: &mut impl Output)

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)

Source§

fn to_output(&self, output: &mut impl Output)

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)

Source§

fn to_output(&self, output: &mut impl Output)

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)

Source§

fn to_output(&self, output: &mut impl Output)

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)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: InlineOutput, F: ToOutput> ToOutput for (A, B, C, D, E, F)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: InlineOutput, E: ToOutput> ToOutput for (A, B, C, D, E)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<A: InlineOutput, B: InlineOutput, C: InlineOutput, D: ToOutput> ToOutput for (A, B, C, D)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<A: InlineOutput, B: InlineOutput, C: ToOutput> ToOutput for (A, B, C)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<A: InlineOutput, B: ToOutput> ToOutput for (A, B)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<K: InlineOutput, V: InlineOutput> ToOutput for BTreeMap<K, V>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<K: InlineOutput, V: InlineOutput> ToOutput for IndexMap<K, V>

Available on crate feature indexmap only.
Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: ?Sized + ToOutput> ToOutput for &T

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: ?Sized + ToOutput> ToOutput for Arc<T>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: ?Sized + ToOutput> ToOutput for Box<T>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: ?Sized> ToOutput for PhantomData<T>

Source§

fn to_output(&self, _: &mut impl Output)

Source§

impl<T: InlineOutput, N: ArrayLength> ToOutput for GenericArray<T, N>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: InlineOutput, const N: usize> ToOutput for [T; N]

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: InlineOutput> ToOutput for BTreeSet<T>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: InlineOutput> ToOutput for IndexSet<T>

Available on crate feature indexmap only.
Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: InlineOutput> ToOutput for Vec<T>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: InlineOutput> ToOutput for VecDeque<T>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: InlineOutput> ToOutput for [T]

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: ToOutput + TaggedOption> ToOutput for Option<T>

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T: ToOutput> ToOutput for (T,)

Source§

fn to_output(&self, output: &mut impl Output)

Source§

impl<T> ToOutput for dyn Send + Sync + ExtraFor<T>

Source§

fn to_output(&self, _: &mut impl Output)

Source§

impl<const S: usize> ToOutput for CidGeneric<S>

Available on crate feature cid only.
Source§

fn to_output(&self, output: &mut impl Output)

Implementors§

Source§

impl ToOutput for Address

Source§

impl ToOutput for Be<NonZero<i8>>

Source§

impl ToOutput for Be<NonZero<i16>>

Source§

impl ToOutput for Be<NonZero<i32>>

Source§

impl ToOutput for Be<NonZero<i64>>

Source§

impl ToOutput for Be<NonZero<i128>>

Source§

impl ToOutput for Be<NonZero<u8>>

Source§

impl ToOutput for Be<NonZero<u16>>

Source§

impl ToOutput for Be<NonZero<u32>>

Source§

impl ToOutput for Be<NonZero<u64>>

Source§

impl ToOutput for Be<NonZero<u128>>

Source§

impl ToOutput for Be<f32>

Source§

impl ToOutput for Be<f64>

Source§

impl ToOutput for Be<i8>

Source§

impl ToOutput for Be<i16>

Source§

impl ToOutput for Be<i32>

Source§

impl ToOutput for Be<i64>

Source§

impl ToOutput for Be<i128>

Source§

impl ToOutput for Be<u8>

Source§

impl ToOutput for Be<u16>

Source§

impl ToOutput for Be<u32>

Source§

impl ToOutput for Be<u64>

Source§

impl ToOutput for Be<u128>

Source§

impl ToOutput for DiffHashes

Source§

impl ToOutput for Hash

Source§

impl ToOutput for Le<NonZero<i8>>

Source§

impl ToOutput for Le<NonZero<i16>>

Source§

impl ToOutput for Le<NonZero<i32>>

Source§

impl ToOutput for Le<NonZero<i64>>

Source§

impl ToOutput for Le<NonZero<i128>>

Source§

impl ToOutput for Le<NonZero<u8>>

Source§

impl ToOutput for Le<NonZero<u16>>

Source§

impl ToOutput for Le<NonZero<u32>>

Source§

impl ToOutput for Le<NonZero<u64>>

Source§

impl ToOutput for Le<NonZero<u128>>

Source§

impl ToOutput for Le<f32>

Source§

impl ToOutput for Le<f64>

Source§

impl ToOutput for Le<i8>

Source§

impl ToOutput for Le<i16>

Source§

impl ToOutput for Le<i32>

Source§

impl ToOutput for Le<i64>

Source§

impl ToOutput for Le<i128>

Source§

impl ToOutput for Le<u8>

Source§

impl ToOutput for Le<u16>

Source§

impl ToOutput for Le<u32>

Source§

impl ToOutput for Le<u64>

Source§

impl ToOutput for Le<u128>

Source§

impl ToOutput for LpBytes

Source§

impl ToOutput for LpString

Source§

impl ToOutput for OptionalHash

Source§

impl ToOutput for U63

Source§

impl ToOutput for dyn Resolve

Source§

impl ToOutput for dyn Singular

Source§

impl<'a, T: ?Sized> ToOutput for WithHash<'a, T>

Source§

impl<A: InlineOutput + Default + PartialEq, B: ToOutput + Default> ToOutput for DefaultChain<A, B>

Source§

impl<Extra> ToOutput for InlineExtra<Extra>
where Extra: ToOutput,

Source§

impl<K> ToOutput for PartialByteTag<K>

Source§

impl<M> ToOutput for SmExtra<M>

Source§

impl<T, M> ToOutput for MappedExtra<T, M>
where M: InlineOutput, T: ToOutput,

Source§

impl<T, const MAX: usize> ToOutput for EnumTag<T, MAX>
where T: ToOutput,

Source§

impl<T: ?Sized + ToOutput> ToOutput for Mangled<T>

Source§

impl<T: ?Sized> ToOutput for ObjectMarker<T>
where PhantomData<fn() -> T>: ToOutput,

Source§

impl<T: InlineOutput> ToOutput for LpVec<T>

Source§

impl<T: ToOutput> ToOutput for Hashed<T>

Source§

impl<T: ToOutput> ToOutput for Lp<T>

Source§

impl<T: ToOutput> ToOutput for ParseExtra<T>

Source§

impl<T: ToOutput> ToOutput for WithRepr<T>

Source§

impl<T: ToOutput> ToOutput for Zt<T>