Struct poem::test::TestJsonObject
source · [−]pub struct TestJsonObject<'a>(_);
Available on crate feature
test
only.Expand description
A JSON object.
Implementations
sourceimpl<'a> TestJsonObject<'a>
impl<'a> TestJsonObject<'a>
sourcepub fn get(&self, name: impl AsRef<str>) -> TestJsonValue<'a>
pub fn get(&self, name: impl AsRef<str>) -> TestJsonValue<'a>
Returns the element corresponding to the name
.
sourcepub fn get_opt(&self, name: impl AsRef<str>) -> Option<TestJsonValue<'a>>
pub fn get_opt(&self, name: impl AsRef<str>) -> Option<TestJsonValue<'a>>
Returns the element corresponding to the name
, or None
if the
element does not exists exists.
sourcepub fn iter(&self) -> impl Iterator<Item = (&String, TestJsonValue<'a>)>
pub fn iter(&self) -> impl Iterator<Item = (&String, TestJsonValue<'a>)>
Returns an iterator over the object.
sourcepub fn assert_len(&self, len: usize)
pub fn assert_len(&self, len: usize)
Asserts the object length is equals to len
.
sourcepub fn assert_is_empty(&self)
pub fn assert_is_empty(&self)
Asserts the object is empty.
Trait Implementations
sourceimpl<'a> Clone for TestJsonObject<'a>
impl<'a> Clone for TestJsonObject<'a>
sourcefn clone(&self) -> TestJsonObject<'a>
fn clone(&self) -> TestJsonObject<'a>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for TestJsonObject<'a>
impl<'a> Debug for TestJsonObject<'a>
impl<'a> Copy for TestJsonObject<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for TestJsonObject<'a>
impl<'a> Send for TestJsonObject<'a>
impl<'a> Sync for TestJsonObject<'a>
impl<'a> Unpin for TestJsonObject<'a>
impl<'a> UnwindSafe for TestJsonObject<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more