Coverage Report

Created: 2022-07-04 16:17

src/client/virtual_cam.rs
Line
Count
Source
1
use super::Client;
2
use crate::{requests::virtual_cam::Request, responses::virtual_cam as responses, Result};
3
4
/// API functions related to the virtual camera.
5
pub struct VirtualCam<'a> {
6
    pub(super) client: &'a Client,
7
}
8
9
impl<'a> VirtualCam<'a> {
10
    /// Gets the status of the virtual cam output.
11
19
    pub async fn status(&self) -> Result<bool> {
<obws::client::virtual_cam::VirtualCam>::status
Line
Count
Source
11
19
    pub async fn status(&self) -> Result<bool> {
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::status
12
19
        self.client
13
38
            .send_message::<_, responses::OutputActive>(Request::Status)
14
38
            .await
15
19
            .map(|oa| oa.active)
<obws::client::virtual_cam::VirtualCam>::status::{closure#0}::{closure#0}
Line
Count
Source
15
19
            .map(|oa| oa.active)
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::status::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::status::{closure#0}::{closure#0}
16
19
    }
<obws::client::virtual_cam::VirtualCam>::status::{closure#0}
Line
Count
Source
12
19
        self.client
13
38
            .send_message::<_, responses::OutputActive>(Request::Status)
14
38
            .await
15
19
            .map(|oa| oa.active)
16
19
    }
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::status::{closure#0}
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::status::{closure#0}
17
18
    /// Toggles the state of the virtual cam output.
19
2
    pub async fn toggle(&self) -> Result<bool> {
<obws::client::virtual_cam::VirtualCam>::toggle
Line
Count
Source
19
2
    pub async fn toggle(&self) -> Result<bool> {
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::toggle
20
2
        self.client
21
4
            .send_message::<_, responses::OutputActive>(Request::Toggle)
22
4
            .await
23
2
            .map(|oa| oa.active)
<obws::client::virtual_cam::VirtualCam>::toggle::{closure#0}::{closure#0}
Line
Count
Source
23
2
            .map(|oa| oa.active)
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::toggle::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::toggle::{closure#0}::{closure#0}
24
2
    }
<obws::client::virtual_cam::VirtualCam>::toggle::{closure#0}
Line
Count
Source
20
2
        self.client
21
4
            .send_message::<_, responses::OutputActive>(Request::Toggle)
22
4
            .await
23
2
            .map(|oa| oa.active)
24
2
    }
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::toggle::{closure#0}
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::toggle::{closure#0}
25
26
    /// Starts the virtual cam output.
27
1
    pub async fn start(&self) -> Result<()> {
<obws::client::virtual_cam::VirtualCam>::start
Line
Count
Source
27
1
    pub async fn start(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::start
28
2
        
self.client.send_message(Request::Start)1
.await
29
1
    }
<obws::client::virtual_cam::VirtualCam>::start::{closure#0}
Line
Count
Source
28
2
        
self.client.send_message(Request::Start)1
.await
29
1
    }
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::start::{closure#0}
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::start::{closure#0}
30
31
    /// Stops the virtual cam output.
32
1
    pub async fn stop(&self) -> Result<()> {
<obws::client::virtual_cam::VirtualCam>::stop
Line
Count
Source
32
1
    pub async fn stop(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::stop
33
2
        
self.client.send_message(Request::Stop)1
.await
34
1
    }
<obws::client::virtual_cam::VirtualCam>::stop::{closure#0}
Line
Count
Source
33
2
        
self.client.send_message(Request::Stop)1
.await
34
1
    }
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::stop::{closure#0}
Unexecuted instantiation: <obws::client::virtual_cam::VirtualCam>::stop::{closure#0}
35
}