use alloc::vec::Vec;
use thiserror::Error;
#[derive(Debug, Clone, Copy, Error)]
#[error("sender task stopped")]
pub struct SendError;
#[derive(Debug, Clone, Copy, Error)]
pub enum CallError {
#[error("response dropped")]
ResponseDropped,
#[error("timed out waiting for response")]
Timeout,
#[error("sender task stopped")]
SenderTaskStopped,
}
#[derive(Debug, Clone, Copy, Error)]
#[error("inbound channel closed")]
pub struct RecvError;
#[derive(Debug, Clone, Copy, Error)]
#[error("disconnected")]
pub struct DisconnectionError;
#[derive(Debug, Error)]
pub enum RunError {
#[error("channel send error: {0}")]
ChanSend(Box<async_channel::SendError<Vec<u8>>>),
#[error(transparent)]
WebSocket(#[from] tungstenite::Error),
}