pub struct TlsIgtlServer { /* private fields */ }
Expand description
TLS-encrypted OpenIGTLink server
Provides secure server with encryption and optional client authentication.
§Examples
use openigtlink_rust::io::TlsIgtlServer;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let server = TlsIgtlServer::bind(
"0.0.0.0:18944",
"cert.pem",
"key.pem"
).await?;
let connection = server.accept().await?;
Ok(())
}
Implementations§
Source§impl TlsIgtlServer
impl TlsIgtlServer
Sourcepub async fn bind(addr: &str, cert_path: &str, key_path: &str) -> Result<Self>
pub async fn bind(addr: &str, cert_path: &str, key_path: &str) -> Result<Self>
Bind to a local address with TLS using certificate files
§Arguments
addr
- Local address to bind (e.g., “0.0.0.0:18944”)cert_path
- Path to PEM-encoded certificate filekey_path
- Path to PEM-encoded private key file
§Errors
IgtlError::Io
- Failed to bind or load certificates
Sourcepub async fn bind_with_config(addr: &str, config: ServerConfig) -> Result<Self>
pub async fn bind_with_config(addr: &str, config: ServerConfig) -> Result<Self>
Bind with custom TLS configuration
Allows advanced configuration like client authentication, cipher suites, etc.
Sourcepub async fn accept(&self) -> Result<TlsIgtlConnection>
pub async fn accept(&self) -> Result<TlsIgtlConnection>
Accept a new TLS client connection
Performs TCP accept followed by TLS handshake.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Get the local address this server is bound to
Auto Trait Implementations§
impl !Freeze for TlsIgtlServer
impl !RefUnwindSafe for TlsIgtlServer
impl Send for TlsIgtlServer
impl Sync for TlsIgtlServer
impl Unpin for TlsIgtlServer
impl !UnwindSafe for TlsIgtlServer
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