Skip to main content

NativeProviderOperation

Trait NativeProviderOperation 

Source
pub trait NativeProviderOperation: Send {
    // Required methods
    fn request_stop(&mut self) -> Result<(), NativeProviderOperationError>;
    fn request_force_stop(&mut self) -> Result<(), NativeProviderOperationError>;
    fn try_wait(
        &mut self,
    ) -> Result<Option<NativeProviderExit>, NativeProviderOperationError>;
    fn try_poll_result(
        &mut self,
    ) -> Result<NativeProviderResultPoll, NativeProviderOperationError>;
}
Expand description

Provider-specific ownership of one physical operation.

request_stop asks for cooperative shutdown. request_force_stop must terminate the entire provider-owned resource tree after the bounded grace window. try_wait is the sole source of physical-exit truth and must return Some only after every owned OS resource has been reaped. A failed stop request does not release the implementer from continuing to service try_wait. Both stop methods must be idempotent.

Implementations must also make their own Drop fail-safe for live native resources. Dropping ProviderSupervisor makes one best-effort force-stop request, but is not the clean shutdown protocol and cannot prove reaping.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§