1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! In-process / bound-port mock ONVIF device for testing client code without a
//! real camera.
//!
//! Every vendor's ONVIF differs and depending on a physical IP camera in unit
//! tests is painful. This module answers SOAP requests with plausible, stateful
//! canned responses (Set persists, Get reflects it) covering every operation
//! oxvif implements.
//!
//! Two entry points, behind features:
//!
//! - **`mock`** → [`MockTransport`]: an in-process [`Transport`](crate::transport::Transport).
//! No sockets, no axum — the fast path for unit tests.
//!
//! ```no_run
//! use std::sync::Arc;
//! use oxvif::{OnvifClient, mock::MockTransport};
//! # async fn run() -> Result<(), oxvif::OnvifError> {
//! let client = OnvifClient::new("http://mock")
//! .with_transport(Arc::new(MockTransport::new()));
//! let profiles = client.get_profiles("http://mock/media").await?;
//! # Ok(()) }
//! ```
//!
//! - **`mock-server`** → [`MockServer`]: a real HTTP server bound to an
//! ephemeral port (pulls `axum`), for when you need an actual endpoint.
//!
//! ```ignore
//! let server = oxvif::mock::MockServer::start().await?;
//! let client = oxvif::OnvifClient::new(server.device_url());
//! ```
//!
//! State is in-memory; the library never writes to disk. Opt into persistence
//! via [`MockState::set_on_change`].
pub use ;
pub use MockTransport;
pub use MockServer;