struct McpRequestCancellationBridge {
stop: Arc<AtomicBool>,
monitor: Option<JoinHandle<()>>,
probe: Arc<dyn Fn() -> bool + Send + Sync>,
}Expand description
Bridge one RMCP request cancellation token into synchronous index work.
Fields§
§stop: Arc<AtomicBool>Signal used to stop the request-local cancellation monitor.
monitor: Option<JoinHandle<()>>Join handle for the bounded request-local monitor thread.
probe: Arc<dyn Fn() -> bool + Send + Sync>Direct request probe retained for synchronous cancellation fences.
Implementations§
Source§impl McpRequestCancellationBridge
impl McpRequestCancellationBridge
Sourcefn start(
context: &RequestContext<RoleServer>,
control: &IndexWorkControl,
) -> Result<Self, CliError>
fn start( context: &RequestContext<RoleServer>, control: &IndexWorkControl, ) -> Result<Self, CliError>
Start a request-local monitor from one owned RMCP context.
Sourcefn start_with_probe<P>(
probe: P,
control: &IndexWorkControl,
) -> Result<Self, CliError>
fn start_with_probe<P>( probe: P, control: &IndexWorkControl, ) -> Result<Self, CliError>
Start a cancellation monitor from a deterministic probe for tests.
Sourcefn synchronize(&self, control: &IndexWorkControl)
fn synchronize(&self, control: &IndexWorkControl)
Copy the request token into synchronous index-work cancellation.
Trait Implementations§
Source§impl Drop for McpRequestCancellationBridge
impl Drop for McpRequestCancellationBridge
Auto Trait Implementations§
impl !RefUnwindSafe for McpRequestCancellationBridge
impl !UnwindSafe for McpRequestCancellationBridge
impl Freeze for McpRequestCancellationBridge
impl Send for McpRequestCancellationBridge
impl Sync for McpRequestCancellationBridge
impl Unpin for McpRequestCancellationBridge
impl UnsafeUnpin for McpRequestCancellationBridge
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more