add start/stop/restart to effects

fix: add a default always to the get status

chore: Only do updates when the thing is installed.

chore: Make the thing buildable for testing

chore: Add in the debugging

chore: Remove the bluj tracing

chore: Fix the build

Chore: Make these fn's instead of allways ran.

chore: Fix the testing

fix: The stopping/ restarting service

fix: Fix the restarting.
This commit is contained in:
Aiden McClelland
2023-02-09 14:54:06 -07:00
parent 10e3e80042
commit 8ee64d22b3
16 changed files with 554 additions and 383 deletions

View File

@@ -1,4 +1,5 @@
use std::future::Future;
use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf};
use std::time::Duration;
@@ -93,6 +94,17 @@ impl<T> Future for NonDetachingJoinHandle<T> {
this.0.poll(cx)
}
}
impl<T> Deref for NonDetachingJoinHandle<T> {
type Target = JoinHandle<T>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T> DerefMut for NonDetachingJoinHandle<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
pub struct AtomicFile {
tmp_path: PathBuf,

View File

@@ -76,8 +76,8 @@ pub trait OsApi: Send + Sync + 'static {
async fn unbind_local(&self, id: InterfaceId, external: u16) -> Result<(), Report>;
async fn unbind_onion(&self, id: InterfaceId, external: u16) -> Result<(), Report>;
fn set_started(&self) -> Result<(), Report>;
async fn restart(&self) -> Result<(), Report>;
async fn start(&self) -> Result<(), Report>;
async fn stop(&self) -> Result<(), Report>;
fn set_started(&self);
async fn restart(&self);
async fn start(&self);
async fn stop(&self);
}