summaryrefslogtreecommitdiff
path: root/src/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime.rs')
-rw-r--r--src/runtime.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime.rs b/src/runtime.rs
index 96ffd0d..2d5552d 100644
--- a/src/runtime.rs
+++ b/src/runtime.rs
@@ -7,9 +7,16 @@ pub trait Runtime: Send {
/// Protection must be installed before durable enabled intent changes.
async fn arm(&mut self) -> Result<()>;
async fn apply(&mut self, connection: Option<&Trojan>, generation: u64) -> Result<()>;
+ async fn block(&mut self) -> Result<()> {
+ self.arm().await?;
+ self.apply(None, 0).await
+ }
async fn maintain(&mut self, connection: Option<&Trojan>, generation: u64) -> Result<()> {
self.apply(connection, generation).await
}
+ async fn probe(&mut self, _: &Trojan, _: u64) -> Result<crate::xray::Probe> {
+ bail!("Protected diagnostic probes are unavailable in this runtime")
+ }
/// Called only after disabled intent has been durably recorded.
async fn disable(&mut self) -> Result<()>;
fn routing(&self) -> &str;