Struct poem::test::TestJsonArray
source · [−]pub struct TestJsonArray<'a>(_);
test
only.Expand description
A JSON array.
Implementations
sourceimpl<'a> TestJsonArray<'a>
impl<'a> TestJsonArray<'a>
sourcepub fn get(&self, idx: usize) -> TestJsonValue<'a>
pub fn get(&self, idx: usize) -> TestJsonValue<'a>
Returns the element at index idx
.
sourcepub fn get_opt(&self, idx: usize) -> Option<TestJsonValue<'a>>
pub fn get_opt(&self, idx: usize) -> Option<TestJsonValue<'a>>
Returns the element at index idx
, or None
if the element does not
exists exists.
sourcepub fn iter(&self) -> impl Iterator<Item = TestJsonValue<'a>>
pub fn iter(&self) -> impl Iterator<Item = TestJsonValue<'a>>
Returns an iterator over the array.
sourcepub fn assert_len(&self, len: usize)
pub fn assert_len(&self, len: usize)
Asserts the array length is equals to len
.
sourcepub fn assert_is_empty(&self)
pub fn assert_is_empty(&self)
Asserts the array is empty.
sourcepub fn assert_contains(&self, f: impl FnMut(TestJsonValue<'_>) -> bool)
pub fn assert_contains(&self, f: impl FnMut(TestJsonValue<'_>) -> bool)
Asserts the array contains values that satisfies a predicate.
sourcepub fn assert_contains_exactly_one(&self, f: impl Fn(TestJsonValue<'_>) -> bool)
pub fn assert_contains_exactly_one(&self, f: impl Fn(TestJsonValue<'_>) -> bool)
Asserts the array contains exactly one value that satisfies a predicate.
Trait Implementations
sourceimpl<'a> Clone for TestJsonArray<'a>
impl<'a> Clone for TestJsonArray<'a>
sourcefn clone(&self) -> TestJsonArray<'a>
fn clone(&self) -> TestJsonArray<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for TestJsonArray<'a>
impl<'a> Debug for TestJsonArray<'a>
impl<'a> Copy for TestJsonArray<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for TestJsonArray<'a>
impl<'a> Send for TestJsonArray<'a>
impl<'a> Sync for TestJsonArray<'a>
impl<'a> Unpin for TestJsonArray<'a>
impl<'a> UnwindSafe for TestJsonArray<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more