diff options
Diffstat (limited to 'ext/http/slab.rs')
-rw-r--r-- | ext/http/slab.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/http/slab.rs b/ext/http/slab.rs index 8c285c860..8dd562cc2 100644 --- a/ext/http/slab.rs +++ b/ext/http/slab.rs @@ -234,7 +234,7 @@ impl SlabEntry { self.self_mut().request_body = Some(RequestBodyState::Resource(res)); } - /// Complete this entry, potentially expunging it if it is complete. + /// Complete this entry, potentially expunging it if it is fully complete (ie: dropped as well). pub fn complete(self) { let promise = &self.self_ref().promise; assert!( @@ -251,6 +251,12 @@ impl SlabEntry { } } + /// Has the future for this entry been dropped? ie, has the underlying TCP connection + /// been closed? + pub fn cancelled(&self) -> bool { + self.self_ref().been_dropped + } + /// Get a mutable reference to the response. pub fn response(&mut self) -> &mut Response { self.self_mut().response.as_mut().unwrap() |