#![warn(missing_docs)]
#[cfg(feature = "serde")]
use serde::de::{self, Deserialize};
pub(crate) mod common;
pub(crate) mod data_type;
pub(crate) mod enumeration;
pub(crate) mod record;
mod binary_parser;
pub(crate) use binary_parser::BinaryParser;
mod combinator;
mod error;
#[doc(inline)]
pub use error::Error;
mod remoting_message;
pub use remoting_message::{MethodCall, MethodReturn, RemotingMessage};
pub mod value;
#[doc(inline)]
pub use value::Value;
#[cfg(feature = "serde")]
pub fn from_slice<'i, T>(bytes: &'i [u8]) -> Result<T, de::value::Error>
where
T: Deserialize<'i>,
{
let remoting_message =
RemotingMessage::parse(bytes).map_err(|err| de::Error::custom(format!("parsing error: {}", err)))?;
T::deserialize(remoting_message)
}