Package-level declarations

Types

Link copied to clipboard
class AllPropertiesGetter(val proxy: Proxy)
Link copied to clipboard
Link copied to clipboard
class AsyncPropertyGetter(proxy: Proxy, propertyName: PropertyName)
Link copied to clipboard
class AsyncPropertySetter(proxy: Proxy, propertyName: PropertyName)
Link copied to clipboard
typealias AsyncReplyHandler = (reply: MethodReply, error: Error?) -> Unit
Link copied to clipboard
@Serializable(with = BusName.Companion::class)
value class BusName(val value: String)
Link copied to clipboard
interface Connection : Resource

An interface to D-Bus bus connection. Incorporates implementation of both synchronous and asynchronous D-Bus I/O event loop.

Link copied to clipboard
class Error(val name: String, val errorMessage: String = "") : Exception
Link copied to clipboard
class Flags
Link copied to clipboard
data class InterfaceFlagsVTableItem(val flags: Flags = Flags()) : VTableItem
Link copied to clipboard
@Serializable(with = InterfaceName.Companion::class)
value class InterfaceName(val value: String)

Strong type representing the D-Bus interface name

Link copied to clipboard
data object InvalidSig : SdbusSig
Link copied to clipboard
data class ListSig(val element: SdbusSig) : SdbusSig
Link copied to clipboard
data class MapSig(val t1: SdbusSig, val t2: SdbusSig) : SdbusSig
Link copied to clipboard
@Serializable(with = MemberName.Companion::class)
value class MemberName(val value: String)

Strong type representing the D-Bus member name

Link copied to clipboard
expect sealed class Message

Message represents a D-Bus message, which can be either method MethodCall, MethodReply, Signal, or a PlainMessage.

actual sealed class Message
Link copied to clipboard
typealias MessageHandler = (msg: Message) -> Unit
Link copied to clipboard
expect class MethodCall : Message
actual class MethodCall : Message
Link copied to clipboard
typealias MethodCallback = (msg: MethodCall) -> Unit
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect class MethodReply : Message
actual class MethodReply : Message
Link copied to clipboard
data class MethodVTableItem(val name: MethodName, var inputSignature: Signature? = null, var inputParamNames: List<String> = emptyList(), var outputSignature: Signature? = null, var outputParamNames: List<String> = emptyList(), var callbackHandler: MethodCallback? = null, val flags: Flags = Flags()) : TypedMethodBuilderContext, VTableItem
Link copied to clipboard
class MutablePropertyDelegate<R, T : Any>(proxy: Proxy, interfaceName: InterfaceName, propertyName: PropertyName, serializer: KSerializer<T>, module: SerializersModule, signature: SdbusSig) : PropertyDelegate<R, T> , ReadWriteProperty<R, T>
Link copied to clipboard
interface Object : Resource

Object class represents a D-Bus object instance identified by a specific object path. D-Bus object provides its interfaces, methods, signals and properties on a bus identified by a specific bus name.

Link copied to clipboard
class ObjectManagerProxy(val proxy: Proxy)

Proxy for the ObjectManager interface, allows access to flows containing combinations of objects, their interfaces, and their properties.

Link copied to clipboard
@Serializable(with = ObjectPath.Companion::class)
value class ObjectPath(val value: String)
Link copied to clipboard
Link copied to clipboard
expect class PendingAsyncCall : Resource

PendingAsyncCall represents a simple handle type to cancel the delivery of the asynchronous D-Bus call result to the application.

actual class PendingAsyncCall : Resource
Link copied to clipboard
expect class PlainMessage : Message

Represents any of the message types, or just a message that serves as a container for data

actual class PlainMessage : Message
Link copied to clipboard
data class PrimitiveSig<K, N : CVariable> : SdbusSig
Link copied to clipboard
Link copied to clipboard
open class PropertyDelegate<R, T : Any>(proxy: Proxy, val interfaceName: InterfaceName, val propertyName: PropertyName, type: KSerializer<T>, module: SerializersModule, signature: SdbusSig) : ReadOnlyProperty<R, T>
Link copied to clipboard
Link copied to clipboard
expect class PropertyGetReply : Message
actual class PropertyGetReply : Message
Link copied to clipboard
Link copied to clipboard
expect class PropertySetCall : Message
actual class PropertySetCall : Message
Link copied to clipboard
Link copied to clipboard
data class PropertyVTableItem(val name: PropertyName, var signature: Signature? = null, var getter: PropertyGetCallback? = null, var setter: PropertySetCallback? = null, val flags: Flags = Flags()) : VTableItem
Link copied to clipboard
interface Proxy : Resource
Link copied to clipboard
interface ProxyHolder
Link copied to clipboard
interface Resource

A handle to resource that may be manually released.

Link copied to clipboard
expect sealed class SdbusSig
actual sealed class SdbusSig
Link copied to clipboard
class ServiceConnection(val connection: Connection, val serviceName: ServiceName)

A Simple wrapper around a connection that avoids repeating the service name when creating proxies.

Link copied to clipboard
typealias ServiceName = BusName
Link copied to clipboard
expect class Signal : Message
actual class Signal : Message
Link copied to clipboard
data class SignalEmitter(var interfaceName: InterfaceName = InterfaceName(""), var signalName: SignalName = SignalName(""), var typedMethodArguments: TypedArguments? = null) : TypedArgumentsBuilderContext
Link copied to clipboard
typealias SignalHandler = (signal: Signal) -> Unit
Link copied to clipboard
Link copied to clipboard
data class SignalVTableItem(val name: SignalName, var signature: Signature = Signature(""), var paramNames: List<String> = emptyList(), val flags: Flags = Flags()) : VTableItem
Link copied to clipboard
@Serializable(with = Signature.Companion::class)
value class Signature(val value: String)

Strong type representing the D-Bus object path

Link copied to clipboard
data class StructSig(val signatures: List<SdbusSig>) : SdbusSig
Link copied to clipboard
data class Typed<T : Any>

A reference to a type that can be serialized within a d-bus message.

Link copied to clipboard
data class TypedArguments

A reference to a method argument types and their values that can be serialized within a d-bus message.

Link copied to clipboard

This is a builder context allowing for easy construction of a TypedArguments.

Link copied to clipboard

This is a builder context allowing for easy construction of a TypedMethodCall.

Link copied to clipboard

The definition of a reference to a callback/method invocation.

Link copied to clipboard
expect class UnixFd(fd: Int, adoptFd: Unit) : Resource

UnixFd is a representation of file descriptor D-Bus type that owns the underlying fd, provides access to it, and closes the fd when the UnixFd goes out of scope.

@Serializable(with = UnixFd.Companion::class)
actual class UnixFd(val fd: Int, adoptFd: Unit) : Resource
Link copied to clipboard
@Serializable(with = Variant.Companion::class)
class Variant
Link copied to clipboard
value class VTableBuilder(val items: MutableList<VTableItem>)
Link copied to clipboard
sealed interface VTableItem

Properties

Link copied to clipboard
val SerialDescriptor.asSignature: SdbusSig
Link copied to clipboard
expect val BoolSig: SdbusSig
actual val BoolSig: SdbusSig
Link copied to clipboard
expect val DoubleSig: SdbusSig
actual val DoubleSig: SdbusSig
Link copied to clipboard
expect val IntSig: SdbusSig
actual val IntSig: SdbusSig
Link copied to clipboard
expect val LongSig: SdbusSig
actual val LongSig: SdbusSig
Link copied to clipboard
Link copied to clipboard
expect val ShortSig: SdbusSig
actual val ShortSig: SdbusSig
Link copied to clipboard
Link copied to clipboard
expect val StringSig: SdbusSig
actual val StringSig: SdbusSig
Link copied to clipboard
expect val UByteSig: SdbusSig
actual val UByteSig: SdbusSig
Link copied to clipboard
expect val UIntSig: SdbusSig
actual val UIntSig: SdbusSig
Link copied to clipboard
expect val ULongSig: SdbusSig
actual val ULongSig: SdbusSig
Link copied to clipboard
expect val UnixFdSig: SdbusSig
actual val UnixFdSig: SdbusSig
Link copied to clipboard
expect val UShortSig: SdbusSig
actual val UShortSig: SdbusSig
Link copied to clipboard
expect val VariantSig: SdbusSig
actual val VariantSig: SdbusSig
Link copied to clipboard
expect val VoidSig: SdbusSig
actual val VoidSig: SdbusSig

Functions

Link copied to clipboard
inline fun Object.addVTable(interfaceName: InterfaceName, builder: VTableBuilder.() -> Unit): Resource

Adds a declaration of methods, properties and signals of the object at a given interface

Link copied to clipboard
Link copied to clipboard
inline fun Proxy.callMethod(message: MethodCall, timeout: Duration): MethodReply

inline fun <R : Any> Proxy.callMethod(interfaceName: InterfaceName, methodName: MethodName, builder: MethodInvoker.() -> Unit): R

Calls method on the D-Bus object

Link copied to clipboard
inline suspend fun Proxy.callMethodAsync(message: MethodCall, timeout: Duration): MethodReply
inline fun Proxy.callMethodAsync(message: MethodCall, noinline asyncReplyCallback: AsyncReplyHandler, timeout: Duration): PendingAsyncCall

inline suspend fun <R : Any> Proxy.callMethodAsync(interfaceName: InterfaceName, methodName: MethodName, builder: MethodInvoker.() -> Unit): R

Calls method on the D-Bus object asynchronously

Link copied to clipboard
Link copied to clipboard

Creates/opens D-Bus session bus connection when in a user context, and a system bus connection, otherwise.

Creates/opens D-Bus session bus connection with a name when in a user context, and a system bus connection with a name, otherwise.

Link copied to clipboard

Opens direct D-Bus connection at the given file descriptor

Opens direct D-Bus connection at a custom address

Link copied to clipboard
expect fun createError(errNo: Int, customMsg: String): Error
actual fun createError(errNo: Int, customMsg: String): Error
Link copied to clipboard
expect fun createObject(connection: Connection, objectPath: ObjectPath): Object

Creates instance representing a D-Bus object

actual fun createObject(connection: Connection, objectPath: ObjectPath): Object
Link copied to clipboard
expect fun createProxy(destination: ServiceName, objectPath: ObjectPath, dontRunEventLoopThread: Boolean = false): Proxy
expect fun createProxy(connection: Connection, destination: ServiceName, objectPath: ObjectPath, dontRunEventLoopThread: Boolean = false): Proxy

Creates a proxy object for a specific remote D-Bus object

actual fun createProxy(destination: ServiceName, objectPath: ObjectPath, dontRunEventLoopThread: Boolean): Proxy
actual fun createProxy(connection: Connection, destination: ServiceName, objectPath: ObjectPath, dontRunEventLoopThread: Boolean): Proxy
Link copied to clipboard

Creates/opens D-Bus system connection on a remote host using ssh

Link copied to clipboard
expect fun createServerBus(fd: Int): Connection

Opens direct D-Bus connection at fd as a server

actual fun createServerBus(fd: Int): Connection
Link copied to clipboard

Creates/opens D-Bus session bus connection

Creates/opens D-Bus session bus connection with a name

Link copied to clipboard

Creates/opens D-Bus session bus connection at a custom address

Link copied to clipboard

Creates/opens D-Bus system bus connection

Creates/opens D-Bus system bus connection with a name

Link copied to clipboard
actual fun <T : Any> Message.deserialize(serializer: DeserializationStrategy<T>, module: SerializersModule): T
Link copied to clipboard
Link copied to clipboard
inline fun Object.emitSignal(interfaceName: InterfaceName = InterfaceName(""), signalName: SignalName = SignalName(""), builder: SignalEmitter.() -> Unit)

Emits signal on D-Bus

Link copied to clipboard

Gets values of all properties of the D-Bus object

Link copied to clipboard

Gets values of all properties of the D-Bus object asynchronously

Link copied to clipboard
inline fun <T : Any> Proxy.getProperty(interfaceName: InterfaceName, propertyName: PropertyName): T

Gets value of a property of the D-Bus object

Link copied to clipboard

Gets value of a property of the D-Bus object asynchronously

Link copied to clipboard
Link copied to clipboard

fun <T> KSerializer<T>.maybeDegrouped(groupedReturn: Boolean): KSerializer<T>

Since we combine multiple output arguments into a single struct for methods, we need to modify their serialization to not expect a struct to be wrapping them, degrouping does that wrapping a trickery to avoid it.

Link copied to clipboard
fun VTableBuilder.method(methodName: MethodName, builder: MethodVTableItem.() -> Unit)

Builds a method to be added to the vtable in progress.

Link copied to clipboard
inline fun <R, T : Any> Proxy.mutableDelegate(interfaceName: InterfaceName, propertyName: PropertyName): MutablePropertyDelegate<R, T>
Link copied to clipboard
inline fun Proxy.onSignal(interfaceName: InterfaceName, signalName: SignalName, builder: SignalSubscriber.() -> Unit): Resource

Registers signal handler for a given signal of the D-Bus object

Link copied to clipboard
Link copied to clipboard
inline fun <R, T : Any> Proxy.prop(interfaceName: InterfaceName, propertyName: PropertyName): ReadWriteProperty<R, T>
inline fun VTableBuilder.prop(propertyName: PropertyName, builder: PropertyVTableItem.() -> Unit)
Link copied to clipboard
inline fun <R, T : Any> Proxy.propDelegate(interfaceName: InterfaceName, propertyName: PropertyName): PropertyDelegate<R, T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
actual fun <T> Message.serialize(serializer: SerializationStrategy<T>, module: SerializersModule, arg: T)
Link copied to clipboard
inline fun <T : Any> Proxy.setProperty(interfaceName: InterfaceName, propertyName: PropertyName, value: T, dontExpectReply: Boolean = false)
Link copied to clipboard

Sets value of a property of the D-Bus object asynchronously

Link copied to clipboard
inline fun VTableBuilder.signal(signal: SignalName, builder: SignalVTableItem.() -> Unit)

Builds a signal into the given vtable builder.

Link copied to clipboard
inline fun <T> Proxy.signalFlow(interfaceName: InterfaceName, signalName: SignalName, builder: SignalSubscriber.() -> Unit): Flow<T>
Link copied to clipboard
inline fun <T> signatureOf(): SdbusSig
Link copied to clipboard
inline fun <T : Any> Variant(value: T): Variant
Link copied to clipboard

Convenient way to unify setup of destination.