[−][src]Struct rust_thrift_tls::tls_threaded::TLSTServer
Fixed-size thread-pool blocking Thrift server.
A TLSTServer
listens on a given address and submits accepted connections
to an unbounded queue. Connections from this queue are serviced by
the first available worker thread from a fixed-size thread pool. Each
accepted connection is handled by that worker thread, and communication
over this thread occurs sequentially and synchronously (i.e. calls block).
Accepted connections have an input half and an output half, each of which
uses a TTransport
and TInputProtocol
/TOutputProtocol
to translate
messages to and from byes. Any combination of TInputProtocol
, TOutputProtocol
and TTransport
may be used.
Implementations
impl<PRC, RTF, IPF, WTF, OPF> TLSTServer<PRC, RTF, IPF, WTF, OPF> where
PRC: TProcessor + Send + Sync + 'static,
RTF: TReadTransportFactory + 'static,
IPF: TInputProtocolFactory + 'static,
WTF: TWriteTransportFactory + 'static,
OPF: TOutputProtocolFactory + 'static,
[src]
PRC: TProcessor + Send + Sync + 'static,
RTF: TReadTransportFactory + 'static,
IPF: TInputProtocolFactory + 'static,
WTF: TWriteTransportFactory + 'static,
OPF: TOutputProtocolFactory + 'static,
pub fn new(
read_transport_factory: RTF,
input_protocol_factory: IPF,
write_transport_factory: WTF,
output_protocol_factory: OPF,
processor: PRC,
num_workers: usize,
key_pair: X509Credentials,
root_cert_store: Option<RootCertStore>,
require_client_auth: bool,
connection_hook: Option<fn(_: TLSStream<ServerSession>)>
) -> TLSTServer<PRC, RTF, IPF, WTF, OPF>
[src]
read_transport_factory: RTF,
input_protocol_factory: IPF,
write_transport_factory: WTF,
output_protocol_factory: OPF,
processor: PRC,
num_workers: usize,
key_pair: X509Credentials,
root_cert_store: Option<RootCertStore>,
require_client_auth: bool,
connection_hook: Option<fn(_: TLSStream<ServerSession>)>
) -> TLSTServer<PRC, RTF, IPF, WTF, OPF>
Create a TLSTServer
.
Each accepted connection has an input and output half, each of which
requires a TTransport
and TProtocol
. TLSTServer
uses
read_transport_factory
and input_protocol_factory
to create
implementations for the input, and write_transport_factory
and
output_protocol_factory
to create implementations for the output.
root_cert_store
contains the trust anchors. If None
, the default
(embedded) will be used
require_client_auth
is true if client authentication is enforced.
connection_hook
is an optional callback function that is executed
right after a new connection is established and typically before
TLS handshake is performed.
pub fn listen(&mut self, listen_address: &str) -> Result<()>
[src]
Listen for incoming connections on listen_address
.
listen_address
should be in the form host:port
,
for example: 127.0.0.1:8080
.
Return ()
if successful.
Return Err
when the server cannot bind to listen_address
or there
is an unrecoverable error.
Auto Trait Implementations
impl<PRC, RTF, IPF, WTF, OPF> !RefUnwindSafe for TLSTServer<PRC, RTF, IPF, WTF, OPF>
impl<PRC, RTF, IPF, WTF, OPF> Send for TLSTServer<PRC, RTF, IPF, WTF, OPF> where
IPF: Send,
OPF: Send,
RTF: Send,
WTF: Send,
IPF: Send,
OPF: Send,
RTF: Send,
WTF: Send,
impl<PRC, RTF, IPF, WTF, OPF> !Sync for TLSTServer<PRC, RTF, IPF, WTF, OPF>
impl<PRC, RTF, IPF, WTF, OPF> Unpin for TLSTServer<PRC, RTF, IPF, WTF, OPF> where
IPF: Unpin,
OPF: Unpin,
RTF: Unpin,
WTF: Unpin,
IPF: Unpin,
OPF: Unpin,
RTF: Unpin,
WTF: Unpin,
impl<PRC, RTF, IPF, WTF, OPF> !UnwindSafe for TLSTServer<PRC, RTF, IPF, WTF, OPF>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,