logo

Struct zbus::ConnectionBuilder[][src]

pub struct ConnectionBuilder<'a> { /* fields omitted */ }
Expand description

A builder for zbus::Connection.

Implementations

Create a builder for the session/user message bus connection.

Create a builder for the system-wide message bus connection.

Create a builder for connection that will use the given D-Bus bus address.

Create a builder for connection that will use the given unix stream.

Create a builder for connection that will use the given socket.

The to-be-created connection will be a peer-to-peer connection.

The to-be-created connection will be a server using the given GUID.

The to-be-created connection will wait for incoming client authentication handshake and negotiation messages, for peer-to-peer communications after successful creation.

Set the max number of messages to queue.

Since typically you’d want to set this at instantiation time, you can set it through the builder.

Example
let conn = ConnectionBuilder::session()?
    .max_queued(30)
    .build()
    .await?;
assert_eq!(conn.max_queued(), 30);

// Do something useful with `conn`..

Enable or disable the internal executor thread.

The thread is enabled by default.

See Connection::executor for more details.

Register a D-Bus Interface to be served at a given path.

This is similar to zbus::ObjectServer::at, except that it allows you to have your interfaces available immediately after the connection is established. Typically, this is exactly what you’d want. Also in contrast to zbus::ObjectServer::at, this method will replace any previously added interface with the same name at the same path.

Register a well-known name for this connection on the bus.

This is similar to zbus::Connection::request_name, except the name is requested as part of the connection setup (ConnectionBuilder::build), immediately after interfaces registered (through ConnectionBuilder::serve_at) are advertised. Typically this is exactly what you want.

Build the connection, consuming the builder.

Errors

Until server-side bus connection is supported, attempting to build such a connection will result in Error::Unsupported error.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.