pub struct NullChannel { /* private fields */ }Expand description
No-op channel for headless swarm worker agents.
All operations are discarded — only the return value of handle_message is used.
Implementations§
Trait Implementations§
Source§impl Channel for NullChannel
impl Channel for NullChannel
Source§fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<IncomingMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<IncomingMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start receiving messages. Returns a receiver for incoming messages.
Source§fn send<'life0, 'async_trait>(
&'life0 self,
_message: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
_message: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a message through this channel. Returns an optional message ID for tracking/editing.
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the channel gracefully.
Source§fn send_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_chat_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_chat_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a typing indicator (or equivalent) to the user.
Source§fn send_media<'life0, 'async_trait>(
&'life0 self,
media: OutgoingMedia,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_media<'life0, 'async_trait>(
&'life0 self,
media: OutgoingMedia,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send an attachment. Read more
Source§fn supports_media(&self) -> bool
fn supports_media(&self) -> bool
Whether
send_media will do anything for this channel. Callers that can
fall back to text should check this instead of sending and catching.Source§fn edit<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_chat_id: &'life1 str,
_message_id: &'life2 str,
_new_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn edit<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_chat_id: &'life1 str,
_message_id: &'life2 str,
_new_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Edit a previously sent message if the channel supports it.
Auto Trait Implementations§
impl Freeze for NullChannel
impl RefUnwindSafe for NullChannel
impl Send for NullChannel
impl Sync for NullChannel
impl Unpin for NullChannel
impl UnsafeUnpin for NullChannel
impl UnwindSafe for NullChannel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more