Coverage Report

Created: 2022-07-04 16:17

src/responses/mod.rs
Line
Count
Source (jump to first uncovered line)
1
//! All responses that can be received from the API.
2
3
pub mod config;
4
pub mod filters;
5
pub mod general;
6
pub(crate) mod hotkeys;
7
pub mod inputs;
8
pub mod media_inputs;
9
pub mod outputs;
10
pub mod profiles;
11
pub mod recording;
12
pub(crate) mod replay_buffer;
13
pub mod scene_collections;
14
pub mod scene_items;
15
pub mod scenes;
16
pub mod sources;
17
pub mod streaming;
18
pub mod transitions;
19
pub mod ui;
20
pub(crate) mod virtual_cam;
21
22
use serde::{de, Deserialize, Deserializer};
23
use serde_repr::Deserialize_repr;
24
25
0
#[derive(Debug)]
Unexecuted instantiation: <obws::responses::ServerMessage as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::ServerMessage as core::fmt::Debug>::fmt
26
pub(crate) enum ServerMessage {
27
    /// First message sent from the server immediately on client connection. Contains authentication
28
    /// information if authentication is required. Also contains RPC version for version
29
    /// negotiation.
30
    Hello(Hello),
31
    /// The identify request was received and validated, and the connection is now ready for normal
32
    /// operation.
33
    Identified(Identified),
34
    /// An event coming from OBS has occurred. For example scene switched, source muted.
35
    #[cfg(feature = "events")]
36
    Event(crate::events::Event),
37
    #[cfg(not(feature = "events"))]
38
    Event,
39
    /// `obs-websocket` is responding to a request coming from a client.
40
    RequestResponse(RequestResponse),
41
    /// `obs-websocket` is responding to a request batch coming from the client.
42
    RequestBatchResponse(RequestBatchResponse),
43
}
44
45
impl<'de> Deserialize<'de> for ServerMessage {
46
624
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
47
624
    where
48
624
        D: Deserializer<'de>,
49
624
    {
50
3.12k
        #[derive(
D1.24k
ese
rializ0
e)]
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<serde_json::de::SeqAccess<serde_json::read::StrRead>>
<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::<&mut serde_json::de::Deserializer<serde_json::read::StrRead>>
Line
Count
Source
50
624
        #[derive(Deserialize)]
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<serde_json::de::MapAccess<serde_json::read::StrRead>>
<<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Line
Count
Source
50
1.24k
        #[derive(Deserialize)]
<<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::de::MapKey<serde_json::read::StrRead>>
Line
Count
Source
50
1.24k
        #[derive(Deserialize)]
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::RawServerMessage as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
51
        struct RawServerMessage {
52
            #[serde(rename = "op")]
53
            op_code: OpCode,
54
            #[serde(rename = "d")]
55
            data: serde_json::Value,
56
        }
57
58
624
        #[derive(
Deserialize_0
repr)]
Unexecuted instantiation: <<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::OpCode as serde::de::Deserialize>::deserialize::<&mut serde_json::de::Deserializer<serde_json::read::StrRead>>
Unexecuted instantiation: <<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::OpCode as serde::de::Deserialize>::deserialize::<serde::__private::de::missing_field::MissingFieldDeserializer<serde_json::error::Error>>
Unexecuted instantiation: <<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::OpCode as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::OpCode as serde::de::Deserialize>::deserialize::<_>
59
        #[repr(u8)]
60
        enum OpCode {
61
            /// The initial message sent by obs-websocket to newly connected clients.
62
            Hello = 0,
63
            /// The response sent by obs-websocket to a client after it has successfully identified
64
            /// with obs-websocket.
65
            Identified = 2,
66
            /// The message sent by obs-websocket containing an event payload.
67
            Event = 5,
68
            /// The message sent by obs-websocket in response to a particular request from a client.
69
            RequestResponse = 7,
70
            /// The message sent by obs-websocket in response to a particular batch of requests from
71
            /// a client.
72
            RequestBatchResponse = 9,
73
        }
74
75
624
        let raw = RawServerMessage::deserialize(deserializer)
?0
;
76
77
624
        Ok(match raw.op_code {
78
            OpCode::Hello => {
79
18
                ServerMessage::Hello(serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
)
80
            }
81
            OpCode::Identified => ServerMessage::Identified(
82
18
                serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
,
83
            ),
84
            OpCode::Event => {
85
                #[cfg(feature = "events")]
86
                {
87
                    ServerMessage::Event(
88
242
                        serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
,
89
                    )
90
                }
91
                #[cfg(not(feature = "events"))]
92
                {
93
                    ServerMessage::Event
94
                }
95
            }
96
            OpCode::RequestResponse => ServerMessage::RequestResponse(
97
346
                serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
,
98
            ),
99
            OpCode::RequestBatchResponse => ServerMessage::RequestBatchResponse(
100
0
                serde_json::from_value(raw.data).map_err(de::Error::custom)?,
101
            ),
102
        })
103
624
    }
<obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::<&mut serde_json::de::Deserializer<serde_json::read::StrRead>>
Line
Count
Source
46
624
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
47
624
    where
48
624
        D: Deserializer<'de>,
49
624
    {
50
        #[derive(Deserialize)]
51
        struct RawServerMessage {
52
            #[serde(rename = "op")]
53
            op_code: OpCode,
54
            #[serde(rename = "d")]
55
            data: serde_json::Value,
56
        }
57
58
        #[derive(Deserialize_repr)]
59
        #[repr(u8)]
60
        enum OpCode {
61
            /// The initial message sent by obs-websocket to newly connected clients.
62
            Hello = 0,
63
            /// The response sent by obs-websocket to a client after it has successfully identified
64
            /// with obs-websocket.
65
            Identified = 2,
66
            /// The message sent by obs-websocket containing an event payload.
67
            Event = 5,
68
            /// The message sent by obs-websocket in response to a particular request from a client.
69
            RequestResponse = 7,
70
            /// The message sent by obs-websocket in response to a particular batch of requests from
71
            /// a client.
72
            RequestBatchResponse = 9,
73
        }
74
75
624
        let raw = RawServerMessage::deserialize(deserializer)
?0
;
76
77
624
        Ok(match raw.op_code {
78
            OpCode::Hello => {
79
18
                ServerMessage::Hello(serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
)
80
            }
81
            OpCode::Identified => ServerMessage::Identified(
82
18
                serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
,
83
            ),
84
            OpCode::Event => {
85
                #[cfg(feature = "events")]
86
                {
87
                    ServerMessage::Event(
88
242
                        serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
,
89
                    )
90
                }
91
                #[cfg(not(feature = "events"))]
92
                {
93
                    ServerMessage::Event
94
                }
95
            }
96
            OpCode::RequestResponse => ServerMessage::RequestResponse(
97
346
                serde_json::from_value(raw.data).map_err(de::Error::custom)
?0
,
98
            ),
99
            OpCode::RequestBatchResponse => ServerMessage::RequestBatchResponse(
100
0
                serde_json::from_value(raw.data).map_err(de::Error::custom)?,
101
            ),
102
        })
103
624
    }
Unexecuted instantiation: <obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <obws::responses::ServerMessage as serde::de::Deserialize>::deserialize::<_>
104
}
105
106
/// First message sent from the server immediately on client connection. Contains authentication
107
/// information if authentication is required. Also contains RPC version for version negotiation.
108
126
#[derive(
Debug0
,
D54
ese
rializ18
e)]
Unexecuted instantiation: <obws::responses::Hello as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::Hello as core::fmt::Debug>::fmt
<obws::responses::Hello as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Line
Count
Source
108
18
#[derive(Debug, Deserialize)]
<<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer>
Line
Count
Source
108
54
#[derive(Debug, Deserialize)]
<<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Line
Count
Source
108
54
#[derive(Debug, Deserialize)]
<<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer>
Line
Count
Source
108
72
#[derive(Debug, 
Dese18
rializ18
e)]
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>
Unexecuted instantiation: <obws::responses::Hello as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <obws::responses::Hello as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Hello as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
109
pub(crate) struct Hello {
110
    #[allow(dead_code)]
111
    #[serde(rename = "obsWebSocketVersion")]
112
    pub obs_web_socket_version: semver::Version,
113
    /// version number which gets incremented on each **breaking change** to the obs-websocket
114
    /// protocol. Its usage in this context is to provide the current RPC version that the server
115
    /// would like to use.
116
    #[serde(rename = "rpcVersion")]
117
    pub rpc_version: u32,
118
    #[serde(rename = "authentication")]
119
    pub authentication: Option<Authentication>,
120
}
121
122
/// The identify request was received and validated, and the connection is now ready for normal
123
/// operation.
124
54
#[derive(
Debug0
,
D36
eserialize)]
Unexecuted instantiation: <obws::responses::Identified as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::Identified as core::fmt::Debug>::fmt
<obws::responses::Identified as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Line
Count
Source
124
18
#[derive(Debug, Deserialize)]
<<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer>
Line
Count
Source
124
36
#[derive(Debug, 
D18
eserialize)]
<<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Line
Count
Source
124
18
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>
<<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer>
Line
Count
Source
124
18
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <obws::responses::Identified as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <obws::responses::Identified as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Identified as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
125
pub(crate) struct Identified {
126
    /// The RPC (remote procedure call) version to be used.
127
    #[serde(rename = "negotiatedRpcVersion")]
128
    pub negotiated_rpc_version: u32,
129
}
130
131
/// `obs-websocket` is responding to a request coming from a client.
132
2.91k
#[derive(
Debug0
,
D1.28k
ese
rializ248
e)]
Unexecuted instantiation: <obws::responses::RequestResponse as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::RequestResponse as core::fmt::Debug>::fmt
<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Line
Count
Source
132
346
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>
<<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer>
Line
Count
Source
132
1.28k
#[derive(Debug, Deserialize)]
<<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Line
Count
Source
132
1.28k
#[derive(Debug, Deserialize)]
<<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer>
Line
Count
Source
132
1.63k
#[derive(Debug, 
Dese248
rializ248
e)]
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::RequestResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
133
pub(crate) struct RequestResponse {
134
    #[allow(dead_code)]
135
    #[serde(rename = "requestType")]
136
    pub r#type: String,
137
    #[serde(rename = "requestId")]
138
    pub id: String,
139
    #[serde(rename = "requestStatus")]
140
    pub status: Status,
141
    #[serde(rename = "responseData", default)]
142
    pub data: serde_json::Value,
143
}
144
145
0
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <obws::responses::RequestBatchResponse as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::RequestBatchResponse as core::fmt::Debug>::fmt
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer>
Unexecuted instantiation: <obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::RequestBatchResponse as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
146
pub(crate) struct RequestBatchResponse {
147
    #[allow(dead_code)]
148
    #[serde(rename = "requestId")]
149
    pub id: String,
150
    #[allow(dead_code)]
151
    pub results: Vec<serde_json::Value>,
152
}
153
154
90
#[derive(
Debug0
,
D36
ese
rializ0
e)]
Unexecuted instantiation: <obws::responses::Authentication as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::Authentication as core::fmt::Debug>::fmt
<<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer>
Line
Count
Source
154
36
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>
<obws::responses::Authentication as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Line
Count
Source
154
18
#[derive(Debug, Deserialize)]
<<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Line
Count
Source
154
36
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <obws::responses::Authentication as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <obws::responses::Authentication as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Authentication as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
155
pub(crate) struct Authentication {
156
    pub challenge: String,
157
    pub salt: String,
158
}
159
160
1.73k
#[derive(
Debug346
,
D692
ese
rializ346
e)]
<obws::responses::Status as core::fmt::Debug>::fmt
Line
Count
Source
160
346
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <obws::responses::Status as core::fmt::Debug>::fmt
<<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer>
Line
Count
Source
160
1.03k
#[derive(Debug, 
Dese346
rializ346
e)]
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>
Unexecuted instantiation: <obws::responses::Status as serde::de::Deserialize>::deserialize::<serde::__private::de::missing_field::MissingFieldDeserializer<serde_json::error::Error>>
<<obws::responses::Status as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer>
Line
Count
Source
160
692
#[derive(Debug, Deserialize)]
<obws::responses::Status as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Line
Count
Source
160
346
#[derive(Debug, Deserialize)]
<<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error>
Line
Count
Source
160
692
#[derive(Debug, Deserialize)]
Unexecuted instantiation: <obws::responses::Status as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting
Unexecuted instantiation: <obws::responses::Status as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_>
Unexecuted instantiation: <<obws::responses::Status as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting
161
pub(crate) struct Status {
162
    /// Is true if the request resulted in [`StatusCode::Success`]. False if otherwise.
163
    pub result: bool,
164
    pub code: StatusCode,
165
    /// May be provided by the server on errors to offer further details on why a request failed.
166
    pub comment: Option<String>,
167
}
168
169
/// The status code gives information about the result of a request. It gives further insight into
170
/// what went wrong, if a request failed.
171
346
#[derive(Debug, 
Deserialize_0
repr)]
<obws::responses::StatusCode as core::fmt::Debug>::fmt
Line
Count
Source
171
346
#[derive(Debug, Deserialize_repr)]
Unexecuted instantiation: <obws::responses::StatusCode as core::fmt::Debug>::fmt
Unexecuted instantiation: <obws::responses::StatusCode as serde::de::Deserialize>::deserialize::<serde_json::value::Value>
Unexecuted instantiation: <obws::responses::StatusCode as serde::de::Deserialize>::deserialize::<serde::__private::de::missing_field::MissingFieldDeserializer<serde_json::error::Error>>
Unexecuted instantiation: <obws::responses::StatusCode as serde::de::Deserialize>::deserialize::<_>
Unexecuted instantiation: <obws::responses::StatusCode as serde::de::Deserialize>::deserialize::<_>
172
#[repr(u16)]
173
pub enum StatusCode {
174
    /// Unknown status, should never be used.
175
    Unknown = 0,
176
177
    /// For internal use to signify a successful field check.
178
    NoError = 10,
179
180
    /// The request has succeeded.
181
    Success = 100,
182
183
    /// The `requestType` field is missing from the request data.
184
    MissingRequestType = 203,
185
    /// The request type is invalid or does not exist.
186
    UnknownRequestType = 204,
187
    /// Generic error code.
188
    ///
189
    /// **Note:** A comment is required to be provided by obs-websocket.
190
    GenericError = 205,
191
    /// The request batch execution type is not supported.
192
    UnsupportedRequestBatchExecutionType = 206,
193
194
    /// A required request field is missing.
195
    MissingRequestField = 300,
196
    /// The request does not have a valid `requestData` object.
197
    MissingRequestData = 301,
198
199
    /// Generic invalid request field message.
200
    ///
201
    /// **Note:** A comment is required to be provided by obs-websocket.
202
    InvalidRequestField = 400,
203
    /// A request field has the wrong data type.
204
    InvalidRequestFieldType = 401,
205
    /// A request field (number) is outside the allowed range.
206
    RequestFieldOutOfRange = 402,
207
    /// A request field (string or array) is empty and cannot be.
208
    RequestFieldEmpty = 403,
209
    /// There are too many request fields (For example a request takes two optional fields, where
210
    /// only one is allowed at a time).
211
    TooManyRequestFields = 404,
212
213
    /// An output is running and cannot be in order to perform the request.
214
    OutputRunning = 500,
215
    /// An output is not running and should be.
216
    OutputNotRunning = 501,
217
    /// An output is paused and should not be.
218
    OutputPaused = 502,
219
    /// An output is not paused and should be.
220
    OutputNotPaused = 503,
221
    /// An output is disabled and should not be.
222
    OutputDisabled = 504,
223
    /// Studio mode is active and cannot be.
224
    StudioModeActive = 505,
225
    /// Studio mode is not active and should be.
226
    StudioModeNotActive = 506,
227
228
    /// The resource was not found.
229
    ///
230
    /// **Note:** Resources are any kind of object in obs-websocket, like inputs, profiles, outputs,
231
    /// etc.
232
    ResourceNotFound = 600,
233
    /// The resource already exists.
234
    ResourceAlreadyExists = 601,
235
    /// The type of resource found is invalid.
236
    InvalidResourceType = 602,
237
    /// There are not enough instances of the resource in order to perform the request.
238
    NotEnoughResources = 603,
239
    /// The state of the resource is invalid. For example, if the resource is blocked from being
240
    /// accessed.
241
    InvalidResourceState = 604,
242
    /// The specified input (obs_source_t-OBS_SOURCE_TYPE_INPUT) had the wrong kind.
243
    InvalidInputKind = 605,
244
    /// The resource does not support being configured.
245
    ///
246
    /// This is particularly relevant to transitions, where they do not always have changeable
247
    /// settings.
248
    ResourceNotConfigurable = 606,
249
    /// The specified filter had the wrong kind.
250
    InvalidFilterKind = 607,
251
252
    /// Creating the resource failed.
253
    ResourceCreationFailed = 700,
254
    /// Performing an action on the resource failed.
255
    ResourceActionFailed = 701,
256
    /// Processing the request failed unexpectedly.
257
    ///
258
    /// **Note:** A comment is required to be provided by obs-websocket.
259
    RequestProcessingFailed = 702,
260
    /// The combination of request fields cannot be used to perform an action.
261
    CannotAct = 703,
262
}