pub struct HttpRpcServer { /* private fields */ }Expand description
HTTP/HTTPS server for handling RPC requests
Implementations§
Source§impl HttpRpcServer
impl HttpRpcServer
Sourcepub fn new(rpc_server: Arc<RpcServer>, bind_addr: SocketAddr) -> Self
pub fn new(rpc_server: Arc<RpcServer>, bind_addr: SocketAddr) -> Self
Create a new plain HTTP RPC server (no TLS)
Sourcepub fn with_acceptor(
rpc_server: Arc<RpcServer>,
bind_addr: SocketAddr,
tls_acceptor: TlsAcceptor,
) -> Self
pub fn with_acceptor( rpc_server: Arc<RpcServer>, bind_addr: SocketAddr, tls_acceptor: TlsAcceptor, ) -> Self
Create a new mTLS RPC server with a pre-built TLS acceptor
Sourcepub fn with_mtls<P: AsRef<Path>>(
rpc_server: Arc<RpcServer>,
bind_addr: SocketAddr,
cert_path: P,
key_path: P,
ca_cert_path: P,
) -> Result<Self>
pub fn with_mtls<P: AsRef<Path>>( rpc_server: Arc<RpcServer>, bind_addr: SocketAddr, cert_path: P, key_path: P, ca_cert_path: P, ) -> Result<Self>
Create a new mTLS RPC server from file paths
§Arguments
rpc_server- The RPC server to handle requestsbind_addr- Address to bind tocert_path- Path to server certificate PEM filekey_path- Path to server private key PEM fileca_cert_path- Path to CA certificate for client verification
Sourcepub fn with_health_provider(self, provider: HealthProvider) -> Self
pub fn with_health_provider(self, provider: HealthProvider) -> Self
Set a health provider function that returns HealthResponse
Auto Trait Implementations§
impl Freeze for HttpRpcServer
impl !RefUnwindSafe for HttpRpcServer
impl Send for HttpRpcServer
impl Sync for HttpRpcServer
impl Unpin for HttpRpcServer
impl UnsafeUnpin for HttpRpcServer
impl !UnwindSafe for HttpRpcServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more