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>
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'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
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 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
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.