1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
use crate::GraphResponse; use graph_error::GraphFailure; use std::marker::PhantomData; #[allow(clippy::large_enum_variant)] pub enum Delta<T> { Next(GraphResponse<T>), Done(Option<GraphFailure>), } impl<T> std::fmt::Debug for Delta<T> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match &self { Delta::Next(response) => f .debug_struct("GraphResponse") .field("status", &response.status()) .field("headers", &response.headers()) .field("body", &"[REDACTED]") .finish(), Delta::Done(err) => { if let Some(err) = err { err.fmt(f) } else { f.write_str("Error: None") } } } } } #[derive(Default)] pub struct DeltaPhantom<T> { phantom: PhantomData<T>, }