-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SunDoge
committed
Aug 24, 2023
1 parent
426a4f1
commit 440347a
Showing
9 changed files
with
80 additions
and
44 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
use simdjson_rust::{ondemand::parser::Parser, padded_string::load_padded_string, Result}; | ||
use simdjson_rust::{ondemand, prelude::*, Result}; | ||
|
||
fn main() -> Result<()> { | ||
// let mut parser = dom::Parser::default(); | ||
// let tweets = parser.load("json-examples/twitter.json")?; | ||
// println!( | ||
// "{} results.", | ||
// tweets | ||
// .at_key("search_metadata")? | ||
// .at_key("count")? | ||
// .get_u64()? | ||
// ); | ||
|
||
let ps = load_padded_string("simdjson-sys/simdjson/jsonexamples/twitter.json")?; | ||
let mut parser = Parser::default(); | ||
let _tweets = parser.iterate(&ps)?; | ||
let mut parser = ondemand::Parser::default(); | ||
let mut tweets = parser.iterate(&ps)?; | ||
println!( | ||
"{} results.", | ||
tweets.at_pointer("/search_metadata/count")?.get_uint64()? | ||
); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
pub mod array; | ||
pub mod array_iterator; | ||
pub mod document; | ||
pub mod field; | ||
pub mod object; | ||
pub mod object_iterator; | ||
pub mod parser; | ||
pub mod value; | ||
pub(crate) mod array; | ||
pub(crate) mod array_iterator; | ||
pub(crate) mod document; | ||
pub(crate) mod field; | ||
pub(crate) mod object; | ||
pub(crate) mod object_iterator; | ||
pub(crate) mod parser; | ||
pub(crate) mod value; | ||
|
||
pub use array::Array; | ||
pub use array_iterator::ArrayIterator; | ||
pub use document::Document; | ||
pub use field::Field; | ||
pub use object::Object; | ||
pub use object_iterator::ObjectIterator; | ||
pub use parser::Parser; | ||
pub use value::Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters