[go: up one dir, main page]

tower 0.5.2

Tower is a library of modular and reusable components for building robust clients and servers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::error::ServiceError;
use tokio::sync::oneshot;

/// Message sent over buffer
#[derive(Debug)]
pub(crate) struct Message<Request, Fut> {
    pub(crate) request: Request,
    pub(crate) tx: Tx<Fut>,
    pub(crate) span: tracing::Span,
}

/// Response sender
pub(crate) type Tx<Fut> = oneshot::Sender<Result<Fut, ServiceError>>;

/// Response receiver
pub(crate) type Rx<Fut> = oneshot::Receiver<Result<Fut, ServiceError>>;