pub struct ChannelSignal { /* private fields */ }Expand description
自定义通道信号
通过 oneshot 通道接收停机信号
§示例
use flare_core_runtime::signal::ChannelSignal;
use tokio::sync::oneshot;
let (tx, rx) = oneshot::channel();
let signal = ChannelSignal::new("custom", rx);
// 发送停机信号
tx.send(()).unwrap();Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ChannelSignal
impl !UnwindSafe for ChannelSignal
impl Freeze for ChannelSignal
impl Send for ChannelSignal
impl Sync for ChannelSignal
impl Unpin for ChannelSignal
impl UnsafeUnpin for ChannelSignal
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