Skip to content

Commit 126b1d4

Browse files
authored
Merge pull request #66 from CookiePieWw/main
feat: add a function to parse jsonb only
2 parents ada713c + fe81859 commit 126b1d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/de.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ pub fn from_slice(buf: &[u8]) -> Result<Value<'_>, Error> {
6262
}
6363
}
6464

65+
pub fn parse_jsonb(buf: &[u8]) -> Result<Value<'_>, Error> {
66+
let mut decoder = Decoder::new(buf);
67+
decoder.decode()
68+
}
69+
6570
#[repr(transparent)]
6671
pub struct Decoder<'a> {
6772
buf: &'a [u8],

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ mod ser;
8080
mod util;
8181
mod value;
8282

83-
pub use de::from_slice;
83+
pub use de::{from_slice, parse_jsonb};
8484
pub use error::Error;
8585
#[allow(unused_imports)]
8686
pub use from::*;

0 commit comments

Comments
 (0)