pub struct Client { /* private fields */ }Expand description
A bird client instance. You need to create a Connection from this client, using Client::connect, to make requests.
You can create multiple Connections from the same client, each with their own independent workflows.
Implementations§
Source§impl Client
impl Client
Sourcepub fn for_unix_socket<P: AsRef<Path>>(unix_socket: P) -> Self
pub fn for_unix_socket<P: AsRef<Path>>(unix_socket: P) -> Self
Creates a new Client using unix_socket file.
This doesn’t establish a new connection, so is guaranteed to
succeed. New connections are created by Client::connect,
which can fail if unix_socket does not exist, or permissions
prevent access.
Sourcepub async fn connect(&self) -> Result<Connection>
pub async fn connect(&self) -> Result<Connection>
Open a new Connection 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.
Sourcepub fn connect_sync(&self) -> Result<SyncConnection>
pub fn connect_sync(&self) -> Result<SyncConnection>
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.