--- /dev/null
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "dbus"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22c08adfeb70c940c14d8af988fa854dcb5529e6141f2397e4e0fa4c9375d094"
+dependencies = [
+ "libc",
+ "libdbus-sys",
+]
+
+[[package]]
+name = "dbus-crossroads"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a816e8ae3382c7b1bccfa6f2778346ee5b13f80e0eccf80cf8f2912af73995a"
+dependencies = [
+ "dbus",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.80"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
+
+[[package]]
+name = "libdbus-sys"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc12a3bc971424edbbf7edaf6e5740483444db63aa8e23d3751ff12a30f306f0"
+dependencies = [
+ "pkg-config",
+]
+
+[[package]]
+name = "mail-dbus"
+version = "0.1.0"
+dependencies = [
+ "dbus",
+ "dbus-crossroads",
+]
+
+[[package]]
+name = "pkg-config"
+version = "0.3.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
--- /dev/null
+[package]
+name = "mail-dbus"
+version = "0.1.0"
+authors = ["Jacob Casper <git@jacobcasper.com>"]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+dbus = "0.9.0"
+dbus-crossroads = "0.3.0"
--- /dev/null
+use dbus::blocking::Connection;
+use dbus_crossroads::{Context, Crossroads};
+use std::error::Error;
+
+fn main() -> Result<(), Box<dyn Error>> {
+ let service_name: &'static str = "com.jacobcasper.Mail";
+ let conn = Connection::new_session()?;
+ conn.request_name(service_name, false, true, false)?;
+
+ let mut crossroads = Crossroads::new();
+
+ let interface_token = crossroads.register(service_name, |builder| {
+ builder.signal::<(u32,), _>("UnreadCount", ("count",));
+ builder.method(
+ "UnreadCount",
+ ("count",),
+ (),
+ |ctx: &mut Context, _, (count,): (u32,)| {
+ ctx.push_msg(ctx.make_signal("UnreadCount", (count,)));
+ Ok(())
+ },
+ );
+ });
+
+ crossroads.insert("/com/jacobcasper/Mail/Unread", &[interface_token], ());
+ crossroads.serve(&conn)?;
+ unreachable!()
+}