pub struct InboundBus<T> { /* private fields */ }Expand description
Sender half of the inbound primitive. Held by the off-thread producer (a
WS task, an LSP forwarder, …); send hands an item to the editor thread
and wakes it.
Clone is implemented manually so T need not be Clone — only the
channel sender and the Arc<Notify> are cloned (a #[derive(Clone)]
would spuriously bound T: Clone).
Implementations§
Source§impl<T> InboundBus<T>
impl<T> InboundBus<T>
Sourcepub fn send(&self, item: T) -> Result<(), T>
pub fn send(&self, item: T) -> Result<(), T>
Send an item and wake the editor so the per-tick drain runs off-keystroke. The wake fires only on a successful send.
Returns the item back on failure (receiver dropped — the subsystem
stopped) so the caller reports a graceful error instead of awaiting a
reply that will never resolve. Mirrors ClaudeCodeInboundBus::send.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for InboundBus<T>
impl<T> RefUnwindSafe for InboundBus<T>
impl<T> Send for InboundBus<T>where
T: Send,
impl<T> Sync for InboundBus<T>where
T: Send,
impl<T> Unpin for InboundBus<T>
impl<T> UnsafeUnpin for InboundBus<T>
impl<T> UnwindSafe for InboundBus<T>
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