1[package]
2name = "zbus"
3version = "4.4.0"
4authors = ["Zeeshan Ali Khan <zeeshanak@gnome.org>"]
5edition = "2021"
6rust-version = "1.75"
7
8description = "API for D-Bus communication"
9repository = "https://github.com/dbus2/zbus/"
10keywords = ["D-Bus", "DBus", "IPC"]
11license = "MIT"
12categories = ["os::unix-apis"]
13readme = "README.md"
14
15[features]
16default = ["async-io"]
17uuid = ["zvariant/uuid"]
18url = ["zvariant/url"]
19time = ["zvariant/time"]
20chrono = ["zvariant/chrono"]
21heapless = ["zvariant/heapless"]
22# Enables ser/de of `Option<T>` as an array of 0 or 1 elements.
23option-as-array = ["zvariant/option-as-array"]
24# Enables API that is only needed for bus implementations (enables `p2p`).
25bus-impl = ["p2p"]
26# Enables API that is only needed for peer-to-peer (p2p) connections.
27p2p = []
28async-io = [
29 "dep:async-io",
30 "async-executor",
31 "async-task",
32 "async-lock",
33 "async-fs",
34 "blocking",
35 "futures-util/io",
36]
37tokio = ["dep:tokio"]
38vsock = ["dep:vsock", "dep:async-io"]
39tokio-vsock = ["dep:tokio-vsock", "tokio"]
40
41[dependencies]
42serde = { version = "1.0.200", features = ["derive"] }
43serde_repr = "0.1.19"
44zvariant = { path = "../zvariant", version = "4.2.0", default-features = false, features = [
45 "enumflags2",
46] }
47zbus_names = { path = "../zbus_names", version = "3.0" }
48zbus_macros = { path = "../zbus_macros", version = "=4.4.0" }
49enumflags2 = { version = "0.7.9", features = ["serde"] }
50async-io = { version = "2.3.2", optional = true }
51futures-core = "0.3.30"
52futures-sink = "0.3.30"
53futures-util = { version = "0.3.30", default-features = false, features = [
54 "sink",
55 "std",
56] }
57async-lock = { version = "3.3.0", optional = true }
58async-broadcast = "0.7.0"
59async-executor = { version = "1.11.0", optional = true }
60blocking = { version = "1.6.0", optional = true }
61async-task = { version = "4.7.1", optional = true }
62hex = "0.4.3"
63ordered-stream = "0.2"
64rand = "0.8.5"
65sha1 = { version = "0.10.6", features = ["std"] }
66event-listener = "5.3.0"
67static_assertions = "1.1.0"
68async-trait = "0.1.80"
69async-fs = { version = "2.1.2", optional = true }
70# FIXME: We should only enable process feature for Mac OS. See comment on async-process below for why we can't.
71tokio = { version = "1.37.0", optional = true, features = [
72 "rt",
73 "net",
74 "time",
75 "fs",
76 "io-util",
77 "process",
78 "sync",
79 "tracing",
80] }
81tracing = "0.1.40"
82vsock = { version = "0.5.0", optional = true }
83tokio-vsock = { version = "0.4", optional = true }
84xdg-home = "1.1.0"
85
86[target.'cfg(windows)'.dependencies]
87windows-sys = { version = "0.52", features = [
88 "Win32_Foundation",
89 "Win32_Security_Authorization",
90 "Win32_System_Memory",
91 "Win32_Networking",
92 "Win32_Networking_WinSock",
93 "Win32_NetworkManagement",
94 "Win32_NetworkManagement_IpHelper",
95 "Win32_System_Threading",
96] }
97uds_windows = "1.1.0"
98
99[target.'cfg(unix)'.dependencies]
100nix = { version = "0.29", default-features = false, features = [
101 "socket",
102 "uio",
103 "user",
104] }
105
106[target.'cfg(target_os = "macos")'.dependencies]
107# FIXME: This should only be enabled if async-io feature is enabled but currently
108# Cargo doesn't provide a way to do that for only specific target OS: https://github.com/rust-lang/cargo/issues/1197.
109async-process = "2.2.2"
110
111[target.'cfg(any(target_os = "macos", windows))'.dependencies]
112async-recursion = "1.1.1"
113
114[dev-dependencies]
115zbus_xml = { path = "../zbus_xml", version = "4.0.0" }
116doc-comment = "0.3.3"
117futures-util = "0.3.30" # activate default features
118ntest = "0.9.2"
119test-log = { version = "0.2.16", features = [
120 "trace",
121], default-features = false }
122tokio = { version = "1.37.0", features = [
123 "macros",
124 "rt-multi-thread",
125 "fs",
126 "io-util",
127 "net",
128 "sync",
129] }
130tracing-subscriber = { version = "0.3.18", features = [
131 "env-filter",
132 "fmt",
133 "ansi",
134], default-features = false }
135tempfile = "3.10.1"
136
137[package.metadata.docs.rs]
138all-features = true
139targets = ["x86_64-unknown-linux-gnu"]
140