pub struct Stopper(/* private fields */);Expand description
Остановщик инстанса: требует остановки с пояснением. Копируется, поэтому подходит для задачи, которая запускает инстанс во владение, и для службы управления.
Первое требование задаёт причину остановки; дальнейшие ничего не меняют.
Implementations§
Source§impl Stopper
impl Stopper
Sourcepub fn stop(&self, reason: impl Into<String>) -> bool
pub fn stop(&self, reason: impl Into<String>) -> bool
Требует остановки. Возвращает false, если инстанс уже останавливается по другой причине.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Stopper
impl Freeze for Stopper
impl Move for Stopper
impl RefUnwindSafe for Stopperwhere
Atomic<usize>: RefUnwindSafe,
RwLock<Option<Stop>>: RefUnwindSafe,
AtomicUsize: RefUnwindSafe,
Notify: RefUnwindSafe,
impl Send for Stopper
impl Sync for Stopper
impl Unpin for Stopper
impl UnsafeUnpin for Stopperwhere
*const ArcInner<Shared<Option<Stop>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared<Option<Stop>>>>: UnsafeUnpin,
impl UnwindSafe for Stopper
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request