mod de;
pub(crate) use de::*;
mod ser;
pub use ser::*;
use crate::{Error, Result, Signature};
pub(crate) fn reject_maybe(signature: &Signature) -> Result<()> {
if signature.contains_maybe() {
return Err(maybe_not_in_dbus());
}
Ok(())
}
pub(crate) fn reject_maybe_in_signature_str(bytes: &[u8]) -> Result<()> {
if bytes.contains(&b'm') {
return Err(maybe_not_in_dbus());
}
Ok(())
}
fn maybe_not_in_dbus() -> Error {
Error::Message(
"GVariant `Maybe` types are not valid in the D-Bus format; use the `zgvariant` crate \
for GVariant serialization"
.to_owned(),
)
}