Skip to content

Commit

Permalink
Merge pull request #66 from CookiePieWw/main
Browse files Browse the repository at this point in the history
feat: add a function to parse jsonb only
  • Loading branch information
b41sh authored Nov 13, 2024
2 parents ada713c + fe81859 commit 126b1d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ pub fn from_slice(buf: &[u8]) -> Result<Value<'_>, Error> {
}
}

pub fn parse_jsonb(buf: &[u8]) -> Result<Value<'_>, Error> {
let mut decoder = Decoder::new(buf);
decoder.decode()
}

#[repr(transparent)]
pub struct Decoder<'a> {
buf: &'a [u8],
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down

0 comments on commit 126b1d4

Please sign in to comment.