# dbus/export Export an object on a connection so other clients can call methods on it (server role). Handlers are pinned for the lifetime of the export. ## Syntax
[dbus/export $conn "/path" "iface" %{ "Method" $fn ... }]
## Parameters - `$conn` — connection from `dbus/connect` - `$path` — object path to own - `$iface` — interface name - `$methods` — map of method name (string or keyword) to handler closure; handlers receive the demarshaled call arguments Exporting the same path/interface replaces the previous set. Handler return values: `nil` → empty reply; `%Err{:message}` → a D-Bus error reply; `%Struct{ :values @{...} }` → multiple out-args; anything else → one out-arg with an inferred signature (maps become `a{sv}` variants). ## Examples
[dbus/export $conn "/org/deft/Test" "org.deft.Test" %{
  "Echo" {|s| $s}
  "Add"  {|a b| ($a + $b)}
  "Info" {|| %{ :name "deft" :version 1 } }
}]

[await [dbus/call $c2 "org.deft.test" "/org/deft/Test" "org.deft.Test" "Echo" "hi"]]
# → "hi"
## Returns `nil`, or `%Err{:message}` on a bad connection/path/interface or when `$methods` is not a map. ## See Also `dbus/unexport`, `dbus/register-name`, `dbus/subscribe`