@@ -6,75 +6,75 @@ use std::{
6
6
7
7
use crate :: State ;
8
8
9
- pin_project ! {
10
- struct Instrumented <F > {
11
- #[ pin]
12
- inner: F ,
13
- observe_context: ObserveContext ,
14
- }
9
+ // pin_project! {
10
+ // struct Instrumented<F> {
11
+ // #[pin]
12
+ // inner: F,
13
+ // observe_context: ObserveContext,
14
+ // }
15
15
16
- impl <F > PinnedDrop for Instrumented <F > {
17
- fn drop( this: Pin <& mut Self >) {
18
- this. project( ) . observe_context. drop_all( ) ;
19
- }
20
- }
21
- }
16
+ // impl<F> PinnedDrop for Instrumented<F> {
17
+ // fn drop(this: Pin<&mut Self>) {
18
+ // this.project().observe_context.drop_all();
19
+ // }
20
+ // }
21
+ // }
22
22
23
- pub trait FutureExt : Future + Sized {
24
- /// Manage WASI Observe guest spans.
25
- fn manage_wasi_observe_spans (
26
- self ,
27
- observe_context : ObserveContext ,
28
- ) -> impl Future < Output = Self :: Output > ;
29
- }
23
+ // pub trait FutureExt: Future + Sized {
24
+ // /// Manage WASI Observe guest spans.
25
+ // fn manage_wasi_observe_spans(
26
+ // self,
27
+ // observe_context: ObserveContext,
28
+ // ) -> impl Future<Output = Self::Output>;
29
+ // }
30
30
31
- impl < F : Future > FutureExt for F {
32
- fn manage_wasi_observe_spans (
33
- self ,
34
- observe_context : ObserveContext ,
35
- ) -> impl Future < Output = Self :: Output > {
36
- Instrumented {
37
- inner : self ,
38
- observe_context,
39
- }
40
- }
41
- }
31
+ // impl<F: Future> FutureExt for F {
32
+ // fn manage_wasi_observe_spans(
33
+ // self,
34
+ // observe_context: ObserveContext,
35
+ // ) -> impl Future<Output = Self::Output> {
36
+ // Instrumented {
37
+ // inner: self,
38
+ // observe_context,
39
+ // }
40
+ // }
41
+ // }
42
42
43
- impl < F : Future > Future for Instrumented < F > {
44
- type Output = F :: Output ;
43
+ // impl<F: Future> Future for Instrumented<F> {
44
+ // type Output = F::Output;
45
45
46
- /// Maintains the invariant that all active spans are entered before polling the inner future
47
- /// and exited otherwise. If we don't do this then the timing (among many other things) of the
48
- /// spans becomes wildly incorrect.
49
- fn poll (
50
- self : std:: pin:: Pin < & mut Self > ,
51
- cx : & mut std:: task:: Context < ' _ > ,
52
- ) -> std:: task:: Poll < Self :: Output > {
53
- let this = self . project ( ) ;
46
+ // /// Maintains the invariant that all active spans are entered before polling the inner future
47
+ // /// and exited otherwise. If we don't do this then the timing (among many other things) of the
48
+ // /// spans becomes wildly incorrect.
49
+ // fn poll(
50
+ // self: std::pin::Pin<&mut Self>,
51
+ // cx: &mut std::task::Context<'_>,
52
+ // ) -> std::task::Poll<Self::Output> {
53
+ // let this = self.project();
54
54
55
- // Enter the active spans before entering the inner poll
56
- {
57
- this. observe_context . state . write ( ) . unwrap ( ) . enter_all ( ) ;
58
- }
55
+ // // Enter the active spans before entering the inner poll
56
+ // {
57
+ // this.observe_context.state.write().unwrap().enter_all();
58
+ // }
59
59
60
- let ret = this. inner . poll ( cx) ;
60
+ // let ret = this.inner.poll(cx);
61
61
62
- // Exit the active spans after exiting the inner poll
63
- {
64
- this. observe_context . state . write ( ) . unwrap ( ) . exit_all ( ) ;
65
- }
62
+ // // Exit the active spans after exiting the inner poll
63
+ // {
64
+ // this.observe_context.state.write().unwrap().exit_all();
65
+ // }
66
66
67
- ret
68
- }
69
- }
67
+ // ret
68
+ // }
69
+ // }
70
70
71
71
/// The context necessary for the observe host component to function.
72
72
pub struct ObserveContext {
73
73
pub ( crate ) state : Arc < RwLock < State > > ,
74
74
}
75
75
76
- impl ObserveContext {
77
- fn drop_all ( & self ) {
78
- self . state . write ( ) . unwrap ( ) . close_from_back_to ( 0 ) ;
79
- }
80
- }
76
+ // impl ObserveContext {
77
+ // fn drop_all(&self) {
78
+ // self.state.write().unwrap().close_from_back_to(0);
79
+ // }
80
+ // }
0 commit comments