Struct poem::test::TestJsonValue
source · [−]pub struct TestJsonValue<'a>(_);
test
only.Expand description
A JSON value.
Implementations
sourceimpl<'a> TestJsonValue<'a>
impl<'a> TestJsonValue<'a>
sourcepub fn i64_array(&self) -> Vec<i64>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn i64_array(&self) -> Vec<i64>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the i64
array.
sourcepub fn f64_array(&self) -> Vec<f64>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn f64_array(&self) -> Vec<f64>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the i64
array.
sourcepub fn bool_array(&self) -> Vec<bool>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn bool_array(&self) -> Vec<bool>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the i64
array.
sourcepub fn assert_i64(&self, value: i64)
pub fn assert_i64(&self, value: i64)
Asserts that value is integer
and it equals to value
.
sourcepub fn assert_bool(&self, value: bool)
pub fn assert_bool(&self, value: bool)
Asserts that value is boolean
and it equals to value
.
sourcepub fn assert_string(&self, value: &str)
pub fn assert_string(&self, value: &str)
Asserts that value is string
and it equals to value
.
sourcepub fn assert_i64_array(&self, values: &[i64])
pub fn assert_i64_array(&self, values: &[i64])
Asserts that value is integer
array and it equals to values
.
sourcepub fn assert_bool_array(&self, values: &[bool])
pub fn assert_bool_array(&self, values: &[bool])
Asserts that value is boolean
array and it equals to values
.
sourcepub fn assert_string_array(&self, values: &[&str])
pub fn assert_string_array(&self, values: &[&str])
Asserts that value is string
array and it equals to values
.
sourcepub fn assert_f64(&self, value: f64)
pub fn assert_f64(&self, value: f64)
Asserts that value is float
and it equals to value
.
sourcepub fn assert_f64_array(&self, values: &[f64])
pub fn assert_f64_array(&self, values: &[f64])
Asserts that value is float
array and it equals to values
.
sourcepub fn string_array(&self) -> Vec<&'a str>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn string_array(&self) -> Vec<&'a str>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the string
array.
sourcepub fn array(&self) -> TestJsonArray<'a>
pub fn array(&self) -> TestJsonArray<'a>
Asserts that the value is an array and return TestJsonArray
.
sourcepub fn object(&self) -> TestJsonObject<'a>
pub fn object(&self) -> TestJsonObject<'a>
Asserts that the value is an object and return TestJsonArray
.
sourcepub fn object_array(&self) -> Vec<TestJsonObject<'a>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn object_array(&self) -> Vec<TestJsonObject<'a>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Asserts that the value is an object array and return
Vec<TestJsonObject>
.
sourcepub fn assert_null(&self)
pub fn assert_null(&self)
Asserts that the value is null.
sourcepub fn assert_not_null(&self)
pub fn assert_not_null(&self)
Asserts that the value is not null.
sourcepub fn deserialize<T: DeserializeOwned>(&self) -> T
pub fn deserialize<T: DeserializeOwned>(&self) -> T
Deserialize the value to T
.
Trait Implementations
sourceimpl<'a> Clone for TestJsonValue<'a>
impl<'a> Clone for TestJsonValue<'a>
sourcefn clone(&self) -> TestJsonValue<'a>
fn clone(&self) -> TestJsonValue<'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 TestJsonValue<'a>
impl<'a> Debug for TestJsonValue<'a>
sourceimpl<'a> PartialEq<TestJsonValue<'a>> for TestJsonValue<'a>
impl<'a> PartialEq<TestJsonValue<'a>> for TestJsonValue<'a>
sourcefn eq(&self, other: &TestJsonValue<'a>) -> bool
fn eq(&self, other: &TestJsonValue<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TestJsonValue<'a>) -> bool
fn ne(&self, other: &TestJsonValue<'a>) -> bool
This method tests for !=
.
sourceimpl<'a> PartialEq<Value> for TestJsonValue<'a>
impl<'a> PartialEq<Value> for TestJsonValue<'a>
impl<'a> Copy for TestJsonValue<'a>
impl<'a> Eq for TestJsonValue<'a>
impl<'a> StructuralEq for TestJsonValue<'a>
impl<'a> StructuralPartialEq for TestJsonValue<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for TestJsonValue<'a>
impl<'a> Send for TestJsonValue<'a>
impl<'a> Sync for TestJsonValue<'a>
impl<'a> Unpin for TestJsonValue<'a>
impl<'a> UnwindSafe for TestJsonValue<'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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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>
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