netloc_stdout/
lib.rs

1//! Print the IP address to stdout.
2
3#![warn(missing_docs)]
4
5use async_trait::async_trait;
6use netloc_core::reporter::{Data, Reporter};
7use std::error::Error;
8
9/// A [`Reporter`] that prints the data to stdout.
10pub struct Stdout;
11
12#[async_trait]
13impl Reporter for Stdout {
14    type Error = Box<dyn Error>;
15
16    async fn report(&self, data: &Data) -> Result<(), Self::Error> {
17        println!("{}", data.ip);
18        Ok(())
19    }
20}