Skip to content

Commit

Permalink
add iter for object
Browse files Browse the repository at this point in the history
  • Loading branch information
SunDoge committed Dec 8, 2023
1 parent 8039298 commit 6ffd66e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resolver = "2"
members = ["simdjson-sys"]

[workspace.package]
version = "0.3.0-alpha.2"
version = "0.3.0-alpha.3"

[workspace.dependencies]
simdjson-sys = { path = "simdjson-sys", version = "0.1.0-alpha.2" }
Expand Down
6 changes: 6 additions & 0 deletions src/dom/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ impl<'a> Object<'a> {
_doc: PhantomData,
}
}

pub fn iter(&self) -> ObjectIter {
let begin = unsafe { NonNull::new_unchecked(ffi::SJ_DOM_object_begin(self.ptr.as_ptr())) };
let end = unsafe { NonNull::new_unchecked(ffi::SJ_DOM_object_end(self.ptr.as_ptr())) };
ObjectIter::new(begin, end)
}
}

pub struct ObjectIter<'a> {
Expand Down

0 comments on commit 6ffd66e

Please sign in to comment.