pub struct Server<Tls = DisabledServerTls, Authentication = TrustServerAuthentication, Middleware = IdentityServerHandler> { /* private fields */ }Expand description
Reusable client-facing PostgreSQL server component.
Implementations§
Source§impl Server
impl Server
Sourcepub fn builder() -> ServerBuilder
pub fn builder() -> ServerBuilder
Starts configuration of a reusable server component.
Source§impl<Tls, Authentication, Middleware> Server<Tls, Authentication, Middleware>where
Tls: ServerTlsConfiguration,
Authentication: ServerAuthenticationProvider,
impl<Tls, Authentication, Middleware> Server<Tls, Authentication, Middleware>where
Tls: ServerTlsConfiguration,
Authentication: ServerAuthenticationProvider,
Sourcepub fn accept<'a, Transport, State, Peer>(
&'a self,
transport: Transport,
peer: Peer,
state: State,
) -> ServerAcceptFuture<'a, Transport, State, Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity, <Middleware as MiddlewareFactory<ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>>::Handler, <Tls::Provider as ServerIdentityProvider>::Error, <Authentication::Authentication as ServerAuthentication<Peer>>::Error>where
Transport: AsyncRead + AsyncWrite + Unpin + 'a,
State: 'a,
Peer: 'a,
Authentication::Authentication: ServerAuthentication<Peer>,
Middleware: MiddlewareFactory<ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>,
<Middleware as MiddlewareFactory<ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>>::Handler: ServerMiddleware<State, ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>,
pub fn accept<'a, Transport, State, Peer>(
&'a self,
transport: Transport,
peer: Peer,
state: State,
) -> ServerAcceptFuture<'a, Transport, State, Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity, <Middleware as MiddlewareFactory<ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>>::Handler, <Tls::Provider as ServerIdentityProvider>::Error, <Authentication::Authentication as ServerAuthentication<Peer>>::Error>where
Transport: AsyncRead + AsyncWrite + Unpin + 'a,
State: 'a,
Peer: 'a,
Authentication::Authentication: ServerAuthentication<Peer>,
Middleware: MiddlewareFactory<ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>,
<Middleware as MiddlewareFactory<ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>>::Handler: ServerMiddleware<State, ServerConnectionContext<Peer, <Authentication::Authentication as ServerAuthentication<Peer>>::Identity>>,
Accepts one transport through TLS negotiation and application authentication.
The caller retains listener and task ownership. state and peer become
owned parts of either returned branch.
§Errors
Returns AcceptError::Io for transport or wire failures,
AcceptError::UnsupportedProtocolVersion for unsupported startup,
AcceptError::TlsRequired when required TLS was bypassed,
AcceptError::TlsIdentity with the provider’s typed error when the
current identity cannot be resolved, AcceptError::Authentication
with the policy’s typed error when authentication rejects the client,
or AcceptError::AuthenticationProtocol for an invalid response to
the selected wire mechanism.