Private
Public Access
1
0

kordophoned becomes a lib

This commit is contained in:
2025-08-20 23:12:31 -07:00
parent e9bda39d8a
commit e51fa3abeb
4 changed files with 7 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ use std::sync::Arc;
use std::{future::Future, thread}; use std::{future::Future, thread};
use tokio::sync::{mpsc, oneshot, Mutex}; use tokio::sync::{mpsc, oneshot, Mutex};
use crate::daemon::{ use kordophoned::daemon::{
contact_resolver::{ContactResolver, DefaultContactResolverBackend}, contact_resolver::{ContactResolver, DefaultContactResolverBackend},
events::{Event, Reply}, events::{Event, Reply},
settings::Settings, settings::Settings,

3
kordophoned/src/lib.rs Normal file
View File

@@ -0,0 +1,3 @@
pub mod daemon;

View File

@@ -1,5 +1,3 @@
mod daemon;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
mod dbus; mod dbus;
@@ -9,7 +7,7 @@ mod xpc;
use log::LevelFilter; use log::LevelFilter;
use std::future; use std::future;
use daemon::Daemon; use kordophoned::daemon::Daemon;
fn initialize_logging() { fn initialize_logging() {
// Weird: is this the best way to do this? // Weird: is this the best way to do this?

View File

@@ -1,4 +1,4 @@
use crate::daemon::{events::Event, signals::Signal, DaemonResult}; use kordophoned::daemon::{events::Event, signals::Signal, DaemonResult};
use crate::xpc::interface::SERVICE_NAME; use crate::xpc::interface::SERVICE_NAME;
use futures_util::StreamExt; use futures_util::StreamExt;
use std::collections::HashMap; use std::collections::HashMap;
@@ -58,7 +58,7 @@ impl XpcAgent {
/// Send an event to the daemon and await its reply. /// Send an event to the daemon and await its reply.
pub async fn send_event<T>( pub async fn send_event<T>(
&self, &self,
make_event: impl FnOnce(crate::daemon::events::Reply<T>) -> Event, make_event: impl FnOnce(kordophoned::daemon::events::Reply<T>) -> Event,
) -> DaemonResult<T> { ) -> DaemonResult<T> {
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
self.event_sink self.event_sink