diff --git a/src/de.rs b/src/de.rs index 2fa7887..1836b77 100644 --- a/src/de.rs +++ b/src/de.rs @@ -62,6 +62,11 @@ pub fn from_slice(buf: &[u8]) -> Result, Error> { } } +pub fn parse_jsonb(buf: &[u8]) -> Result, Error> { + let mut decoder = Decoder::new(buf); + decoder.decode() +} + #[repr(transparent)] pub struct Decoder<'a> { buf: &'a [u8], diff --git a/src/lib.rs b/src/lib.rs index 22a8799..603625e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,7 +80,7 @@ mod ser; mod util; mod value; -pub use de::from_slice; +pub use de::{from_slice, parse_jsonb}; pub use error::Error; #[allow(unused_imports)] pub use from::*;