pub struct ChannelSink { /* private fields */ }Expand description
基于无界 mpsc 的 sink,为 websocket 场景准备:
一个 task 跑 AgentRunTime::run,另一个 task 从 receiver 拉事件推给客户端。
Implementations§
Source§impl ChannelSink
impl ChannelSink
Sourcepub fn new() -> (Arc<Self>, UnboundedReceiver<TrajectoryEvent>)
pub fn new() -> (Arc<Self>, UnboundedReceiver<TrajectoryEvent>)
返回 sink 与配对的 receiver。run 结束、sink 被 drop 后,receiver 收到 None。
Trait Implementations§
Source§impl TrajectorySink for ChannelSink
impl TrajectorySink for ChannelSink
Auto Trait Implementations§
impl Freeze for ChannelSink
impl RefUnwindSafe for ChannelSink
impl Send for ChannelSink
impl Sync for ChannelSink
impl Unpin for ChannelSink
impl UnsafeUnpin for ChannelSink
impl UnwindSafe for ChannelSink
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