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 a Unix Domain Stream Socket.

use std::{io, path::Path};

use tokio::net::UnixStream;

use crate::client::Client;

/// Connects to the IKE daemon via a Unix socket named by `path`. See [`Client`][] for its usage.
pub async fn connect<P>(path: P) -> io::Result<Client>
where
    P: AsRef<Path>,
{
    let session = UnixStream::connect(&path).await?;
    Ok(Client::new(session))
}