use super::super::super::format::*;
#[cfg(feature = "cbor")]
use super::cbor::*;
use {
std::{io, str},
thiserror::*,
};
#[derive(Debug, Error)]
pub enum SerializeError {
#[error("unsupported format: {0:?}")]
UnsupportedFormat(Format),
#[error("I/O: {0}")]
IO(#[from] io::Error),
#[error("UTF8: {0}")]
UTF8(#[from] str::Utf8Error),
#[cfg(feature = "yaml")]
#[error("YAML: {0}")]
YAML(#[from] serde_norway::Error),
#[cfg(feature = "json")]
#[error("JSON: {0}")]
JSON(#[from] struson::serde::SerializerError),
#[cfg(feature = "xml")]
#[error("XML: {0}")]
XML(#[from] serde_xml_rs::Error),
#[cfg(feature = "cbor")]
#[error("CBOR: {0}")]
CBOR(#[from] CborWriteError),
#[cfg(feature = "messagepack")]
#[error("MessagePack: {0}")]
MessagePack(#[from] rmp_serde::encode::Error),
}