Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a function to parse jsonb only #66

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading