Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{ffi::OsString, path::Path};

use crate::{Connection, Result};
use crate::{Connection, Result, SyncConnection};

/// A bird client instance. You need to create a [Connection] from this
/// client, using [Client::connect], to make requests.
Expand Down Expand Up @@ -32,4 +32,13 @@ impl Client {
pub async fn connect(&self) -> Result<Connection> {
Connection::new(&self.unix_socket).await
}

/// Open a new [SyncConnection] to this client. You can open multiple
/// connections to the same client.
///
/// Note that this can fail if the unix socket is closed, or if the
/// initial hello negotiation with the server fails.
pub fn connect_sync(&self) -> Result<SyncConnection> {
SyncConnection::new(&self.unix_socket)
}
}
Loading
Loading