Skip to content

Commit

Permalink
update ruchei-sample docs
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheyca committed Jun 15, 2024
1 parent bb4902c commit 728bcb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ pin-project = "1"
ruchei-callback.workspace = true
ruchei-extra.workspace = true
ruchei-route.workspace = true
# ruchei-sample.workspace = true

futures-util.workspace = true
linked-hash-map.workspace = true
Expand Down
5 changes: 4 additions & 1 deletion internal/ruchei-sample/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Utility for debugging `ruchei`
//! Ad hoc utility for debugging `ruchei`. Not thread safe
use std::{
pin::Pin,
Expand All @@ -22,12 +22,14 @@ impl Drop for Reset {
}
}

/// Create an RAII guard for enabling sampling, resetting to previous value on drop
pub fn enable() -> Reset {
let value = sample();
set(true);
Reset(value)
}

/// Create an RAII guard for disabling sampling, resetting to previous value on drop
pub fn disable() -> Reset {
let value = sample();
set(false);
Expand Down Expand Up @@ -72,6 +74,7 @@ pub fn start() {
thread::spawn(run);
}

#[doc(hidden)]
#[pin_project]
pub struct Exclude<S>(#[pin] pub S);

Expand Down

0 comments on commit 728bcb3

Please sign in to comment.