Skip to main content

connect

Function connect 

Source
pub fn connect(
    socket_name: &str,
    socket_type: &SocketType,
) -> Result<Stream, Error>
Expand description

Connects to the daemon via a local socket and returns the connection Stream.

ยงExamples

let conn = connect(DEFAULT_SOCKET_NAME, &SocketType::default()).unwrap();
let mut conn = BufReader::new(conn);
eprintln!("Connected to the daemon: {conn:?}");
// Run all your commands here!
disconnect(&mut conn).unwrap();