Struct restapi::core::server::connection_handler::ConnectionHandler
source · [−]pub struct ConnectionHandler {
pub config: CoreConfig,
pub db_pool: Pool<PostgresConnectionManager<MakeTlsConnector>>,
pub local_addr: SocketAddr,
pub remote_addr: SocketAddr,
pub tls_info: Option<TlsInfo>,
}Expand description
ConnectionHandler
A date type containing the
hyper Request
with the
CoreConfig
server statics,
tls information, and postgres client db threadpool
(Pool)
Core Config
CoreConfig
for static configuration values
bb8 Threadpool
bb8 thread pool (Pool) containing a
PostgresConnectionManager
client that encrypts the traffic with a
MakeTlsConnector
for db client tls encryption
Socket Data
local_addr - server address
remote_addr - client address
TLS Info
TlsInfo object for tls verification
(this is not optional with the default configuration).
Fields
config: CoreConfigdb_pool: Pool<PostgresConnectionManager<MakeTlsConnector>>local_addr: SocketAddrremote_addr: SocketAddrtls_info: Option<TlsInfo>Trait Implementations
sourceimpl Clone for ConnectionHandler
impl Clone for ConnectionHandler
sourcefn clone(&self) -> ConnectionHandler
fn clone(&self) -> ConnectionHandler
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Service<Request<Body>> for ConnectionHandler
impl Service<Request<Body>> for ConnectionHandler
sourcefn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
poll_ready
please refer to the hyper docs:
poll_ready
https://docs.rs/hyper/latest/hyper/service/trait.Service.html#tymethod.poll_ready
Arguments
_cx-Context
sourcefn call(&mut self, req: Request<Body>) -> Self::Future
fn call(&mut self, req: Request<Body>) -> Self::Future
call
Wrap a received hyper Request from
the api server in a
CoreTaskItem
object and consume the
CoreTaskItem
with the
handle_request
function
Please refer to the hyper docs:
call
https://docs.rs/hyper/latest/hyper/service/trait.Service.html#tymethod.call
Arguments
req- a HyperRequest
type Error = Infallible
type Error = Infallible
Errors produced by the service.
Auto Trait Implementations
impl !RefUnwindSafe for ConnectionHandler
impl Send for ConnectionHandler
impl Sync for ConnectionHandler
impl Unpin for ConnectionHandler
impl !UnwindSafe for ConnectionHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more