pub struct ExpectUuid { /* private fields */ }Expand description
Expects a UUID string.
use axum_test::expect_json;
let server = TestServer::new(Router::new())?;
server.get(&"/user")
.await
.assert_json(&json!({
"id": expect_json::uuid(),
"name": "Alice",
}));Implementations§
Source§impl ExpectUuid
impl ExpectUuid
Trait Implementations§
Source§impl Clone for ExpectUuid
impl Clone for ExpectUuid
Source§fn clone(&self) -> ExpectUuid
fn clone(&self) -> ExpectUuid
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExpectUuid
impl Debug for ExpectUuid
Source§impl Default for ExpectUuid
impl Default for ExpectUuid
Source§fn default() -> ExpectUuid
fn default() -> ExpectUuid
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExpectUuid
impl<'de> Deserialize<'de> for ExpectUuid
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ExpectOp for ExpectUuid
impl ExpectOp for ExpectUuid
fn on_string( &self, context: &mut Context<'_>, received: &str, ) -> ExpectOpResult<()>
Source§fn debug_supported_types(&self) -> &'static [JsonType]
fn debug_supported_types(&self) -> &'static [JsonType]
This is optional to implement. This method returns a list of types this is targeting. Read more
fn on_any( &self, context: &mut Context<'_>, received: &Value, ) -> ExpectOpResult<()>
fn on_null(&self, context: &mut Context<'_>) -> ExpectOpResult<()>
fn on_f64(&self, context: &mut Context<'_>, received: f64) -> ExpectOpResult<()>
fn on_u64(&self, context: &mut Context<'_>, received: u64) -> ExpectOpResult<()>
fn on_i64(&self, context: &mut Context<'_>, received: i64) -> ExpectOpResult<()>
fn on_boolean( &self, context: &mut Context<'_>, received: bool, ) -> ExpectOpResult<()>
fn on_array( &self, context: &mut Context<'_>, received: &[Value], ) -> ExpectOpResult<()>
fn on_object( &self, context: &mut Context<'_>, received: &Map<String, Value>, ) -> ExpectOpResult<()>
Source§impl From<ExpectUuid> for Value
impl From<ExpectUuid> for Value
Source§fn from(value: ExpectUuid) -> Self
fn from(value: ExpectUuid) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ExpectUuid
impl PartialEq for ExpectUuid
Source§impl Serialize for ExpectUuid
impl Serialize for ExpectUuid
impl StructuralPartialEq for ExpectUuid
Auto Trait Implementations§
impl Freeze for ExpectUuid
impl RefUnwindSafe for ExpectUuid
impl Send for ExpectUuid
impl Sync for ExpectUuid
impl Unpin for ExpectUuid
impl UnwindSafe for ExpectUuid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more