pub struct CancellationTest<H> { /* private fields */ }Expand description
Implementations§
Source§impl<H: Handler + 'static> CancellationTest<H>
impl<H: Handler + 'static> CancellationTest<H>
Sourcepub fn test_respects_cancellation(&self) -> CancellationTestResult
pub fn test_respects_cancellation(&self) -> CancellationTestResult
Tests that the handler respects cancellation via checkpoint.
This sets the cancellation flag before calling the handler, then verifies that the handler detects it at a checkpoint and returns an appropriate error response.
Sourcepub fn complete_normally(&self) -> CancellationTestResult
pub fn complete_normally(&self) -> CancellationTestResult
Tests that the handler completes normally without cancellation.
Sourcepub fn test_with_cancel_callback<F>(
&self,
path: &str,
cancel_fn: F,
) -> CancellationTestResult
pub fn test_with_cancel_callback<F>( &self, path: &str, cancel_fn: F, ) -> CancellationTestResult
Tests handler behavior with a custom cancellation callback.
The callback is called with the context and can decide when to trigger cancellation based on custom logic.
Auto Trait Implementations§
impl<H> Freeze for CancellationTest<H>where
H: Freeze,
impl<H> RefUnwindSafe for CancellationTest<H>where
H: RefUnwindSafe,
impl<H> Send for CancellationTest<H>where
H: Send,
impl<H> Sync for CancellationTest<H>where
H: Sync,
impl<H> Unpin for CancellationTest<H>where
H: Unpin,
impl<H> UnwindSafe for CancellationTest<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).