fix debug impl
This commit is contained in:
parent
faf36f5c04
commit
61489dbf5d
|
|
@ -13,7 +13,6 @@ use tower::Service;
|
||||||
|
|
||||||
/// Future that completes when the batch processing is complete.
|
/// Future that completes when the batch processing is complete.
|
||||||
#[pin_project]
|
#[pin_project]
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct ResponseFuture<T, E, R>
|
pub struct ResponseFuture<T, E, R>
|
||||||
where
|
where
|
||||||
T: Service<crate::BatchControl<R>>,
|
T: Service<crate::BatchControl<R>>,
|
||||||
|
|
@ -22,6 +21,20 @@ where
|
||||||
state: ResponseState<T, E, R>,
|
state: ResponseState<T, E, R>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T, E, R> Debug for ResponseFuture<T, E, R>
|
||||||
|
where
|
||||||
|
T: Service<crate::BatchControl<R>>,
|
||||||
|
T::Future: Debug,
|
||||||
|
T::Error: Debug,
|
||||||
|
E: Debug,
|
||||||
|
{
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("ResponseFuture")
|
||||||
|
.field("state", &self.state)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[pin_project(project = ResponseStateProj)]
|
#[pin_project(project = ResponseStateProj)]
|
||||||
enum ResponseState<T, E, R>
|
enum ResponseState<T, E, R>
|
||||||
where
|
where
|
||||||
|
|
@ -35,9 +48,16 @@ where
|
||||||
impl<T, E, R> Debug for ResponseState<T, E, R>
|
impl<T, E, R> Debug for ResponseState<T, E, R>
|
||||||
where
|
where
|
||||||
T: Service<crate::BatchControl<R>>,
|
T: Service<crate::BatchControl<R>>,
|
||||||
|
T::Future: Debug,
|
||||||
|
T::Error: Debug,
|
||||||
|
E: Debug,
|
||||||
{
|
{
|
||||||
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
todo!()
|
match self {
|
||||||
|
ResponseState::Failed(e) => f.debug_tuple("ResponseState::Failed").field(e).finish(),
|
||||||
|
ResponseState::Rx(rx) => f.debug_tuple("ResponseState::Rx").field(rx).finish(),
|
||||||
|
ResponseState::Poll(fut) => f.debug_tuple("ResponseState::Pool").field(fut).finish(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue