acceptor_std/printer/
debug_printer.rs1use core::fmt;
2
3use accepts::{Accepts, AsyncAccepts};
4
5#[must_use = "DebugPrinter must be used to emit output"]
7#[derive(Debug, Clone)]
8pub struct DebugPrinter;
9
10impl<Value> Accepts<Value> for DebugPrinter
11where
12 Value: fmt::Debug,
13{
14 fn accept(&self, value: Value) {
15 println!("{value:?}");
16 }
17}
18
19impl<Value> AsyncAccepts<Value> for DebugPrinter
20where
21 Value: fmt::Debug + Send,
22{
23 fn accept_async<'a>(&'a self, value: Value) -> impl core::future::Future<Output = ()> + 'a
24 where
25 Value: 'a,
26 {
27 async move {
28 println!("{value:?}");
29 }
30 }
31}