use serde::{Deserialize, Serialize};
use crate::{PeerId, SessionId};
#[derive(Debug, Clone, Copy, thiserror::Error, Serialize, Deserialize)]
pub enum InitError {
#[error("the host disconnected from the session")]
HostDisconnected,
#[error("peer {0:?} is already present in the session")]
PeerAlreadyPresent(PeerId),
#[error("session {0} does not exist")]
SessionDoesNotExist(SessionId),
}
impl crate::encode::ShouldCompress for InitError {
#[inline(always)]
fn should_compress(&self) -> bool {
false
}
}