42MNZNAH4QWQPYFUEMXD2OCDH5PRANP4IXEIK3SBYEOMJXTOKQ7QC
pub enum Error {}
pub enum Error {
#[error("can not create socket: {0}")]
CreateSocket(std::io::Error),
#[error("can not connect socket: {0}")]
ConnectSocket(std::io::Error),
#[error("can not serialize message: {0}")]
SerializeMessage(bincode::Error),
#[error("can not send message to socket: {0}")]
SendMessage(std::io::Error),
}
let socket = UnixDatagram::unbound().unwrap();
socket.connect(&self.socket_path).unwrap();
socket.send(&bincode::serialize(&message).unwrap()).unwrap();
let socket = UnixDatagram::unbound().map_err(Error::CreateSocket)?;
socket
.connect(&self.socket_path)
.map_err(Error::ConnectSocket)?;
socket
.send(&bincode::serialize(&message).map_err(Error::SerializeMessage)?)
.map_err(Error::SendMessage)?;
#[error("can not open cache file: {0}")]
OpenCacheFile(std::io::Error),
#[error("can not deserialize cache entries: {0}")]
DeserializeCacheEntries(serde_json::Error),
#[error("can not bind to socket: {0}")]
BindSocket(std::io::Error),
#[error("can not remove socket: {0}")]
RemoveSocket(std::io::Error),
#[error("can not create cache file: {0}")]
CreateCacheFile(std::io::Error),
#[error("can not serialize cache entries: {0}")]
SerializeCacheEntries(serde_json::Error),
#[error("can not receive message from socket: {0}")]
ReceiveFromSocket(std::io::Error),
#[error("can not deserialize message: {0}")]
DeserializeMessage(bincode::Error),