pub struct Source<'process> { /* private fields */ }Expand description
Linear process-lifetime view of the termination signal receiver.
Implementations§
Source§impl Source<'_>
impl Source<'_>
Sourcepub fn scope<'owner, R, E>(
retained: Vacant<'owner, Receiver>,
run: impl for<'process> FnOnce(Source<'process>) -> Result<R, E>,
) -> Result<R, Error<'owner, E>>
pub fn scope<'owner, R, E>( retained: Vacant<'owner, Receiver>, run: impl for<'process> FnOnce(Source<'process>) -> Result<R, E>, ) -> Result<R, Error<'owner, E>>
Enters the exclusive signal scope on the process’s original thread.
Call during single-threaded startup. Other code must not change SIGTERM
handling while run executes; masks on other existing threads are not updated.
Workers must start inside run and finish before the policy is restored.
Trait Implementations§
Auto Trait Implementations§
impl<'process> !RefUnwindSafe for Source<'process>
impl<'process> !Send for Source<'process>
impl<'process> !Sync for Source<'process>
impl<'process> Freeze for Source<'process>
impl<'process> Unpin for Source<'process>
impl<'process> UnsafeUnpin for Source<'process>
impl<'process> UnwindSafe for Source<'process>
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