rsvici 0.1.4

A client library for the VICI protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Connection over TCP.

use std::io;

use tokio::net::{TcpStream, ToSocketAddrs};

use crate::client::Client;

/// Connects to the IKE daemon via a TCP connection. See [`Client`][] for its usage.
pub async fn connect<A>(addr: A) -> io::Result<Client>
where
    A: ToSocketAddrs,
{
    let session = TcpStream::connect(&addr).await?;
    Ok(Client::new(session))
}