Coverage Report

Created: 2022-07-04 16:17

src/client/recording.rs
Line
Count
Source
1
use super::Client;
2
use crate::{requests::recording::Request, responses::recording as responses, Result};
3
4
/// API functions related to recording.
5
pub struct Recording<'a> {
6
    pub(super) client: &'a Client,
7
}
8
9
impl<'a> Recording<'a> {
10
    /// Gets the status of the record output.
11
19
    pub async fn status(&self) -> Result<responses::RecordStatus> {
<obws::client::recording::Recording>::status
Line
Count
Source
11
19
    pub async fn status(&self) -> Result<responses::RecordStatus> {
Unexecuted instantiation: <obws::client::recording::Recording>::status
12
38
        
self.client.send_message(Request::Status)19
.await
13
19
    }
<obws::client::recording::Recording>::status::{closure#0}
Line
Count
Source
12
38
        
self.client.send_message(Request::Status)19
.await
13
19
    }
Unexecuted instantiation: <obws::client::recording::Recording>::status::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::status::{closure#0}
14
15
    /// Toggles the status of the record output.
16
2
    pub async fn toggle(&self) -> Result<bool> {
<obws::client::recording::Recording>::toggle
Line
Count
Source
16
2
    pub async fn toggle(&self) -> Result<bool> {
Unexecuted instantiation: <obws::client::recording::Recording>::toggle
17
2
        self.client
18
4
            .send_message::<_, responses::OutputActive>(Request::Toggle)
19
4
            .await
20
2
            .map(|oa| oa.active)
<obws::client::recording::Recording>::toggle::{closure#0}::{closure#0}
Line
Count
Source
20
2
            .map(|oa| oa.active)
Unexecuted instantiation: <obws::client::recording::Recording>::toggle::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::toggle::{closure#0}::{closure#0}
21
2
    }
<obws::client::recording::Recording>::toggle::{closure#0}
Line
Count
Source
17
2
        self.client
18
4
            .send_message::<_, responses::OutputActive>(Request::Toggle)
19
4
            .await
20
2
            .map(|oa| oa.active)
21
2
    }
Unexecuted instantiation: <obws::client::recording::Recording>::toggle::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::toggle::{closure#0}
22
23
    /// Starts the record output.
24
1
    pub async fn start(&self) -> Result<()> {
<obws::client::recording::Recording>::start
Line
Count
Source
24
1
    pub async fn start(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::recording::Recording>::start
25
2
        
self.client.send_message(Request::Start)1
.await
26
1
    }
<obws::client::recording::Recording>::start::{closure#0}
Line
Count
Source
25
2
        
self.client.send_message(Request::Start)1
.await
26
1
    }
Unexecuted instantiation: <obws::client::recording::Recording>::start::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::start::{closure#0}
27
28
    /// Stops the record output.
29
1
    pub async fn stop(&self) -> Result<String> {
<obws::client::recording::Recording>::stop
Line
Count
Source
29
1
    pub async fn stop(&self) -> Result<String> {
Unexecuted instantiation: <obws::client::recording::Recording>::stop
30
1
        self.client
31
2
            .send_message::<_, responses::OutputStopped>(Request::Stop)
32
2
            .await
33
1
            .map(|os| os.path)
<obws::client::recording::Recording>::stop::{closure#0}::{closure#0}
Line
Count
Source
33
1
            .map(|os| os.path)
Unexecuted instantiation: <obws::client::recording::Recording>::stop::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::stop::{closure#0}::{closure#0}
34
1
    }
<obws::client::recording::Recording>::stop::{closure#0}
Line
Count
Source
30
1
        self.client
31
2
            .send_message::<_, responses::OutputStopped>(Request::Stop)
32
2
            .await
33
1
            .map(|os| os.path)
34
1
    }
Unexecuted instantiation: <obws::client::recording::Recording>::stop::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::stop::{closure#0}
35
36
    /// Toggles pause on the record output.
37
2
    pub async fn toggle_pause(&self) -> Result<bool> {
<obws::client::recording::Recording>::toggle_pause
Line
Count
Source
37
2
    pub async fn toggle_pause(&self) -> Result<bool> {
Unexecuted instantiation: <obws::client::recording::Recording>::toggle_pause
38
2
        self.client
39
4
            .send_message::<_, responses::OutputPaused>(Request::TogglePause)
40
4
            .await
41
2
            .map(|op| op.paused)
<obws::client::recording::Recording>::toggle_pause::{closure#0}::{closure#0}
Line
Count
Source
41
2
            .map(|op| op.paused)
Unexecuted instantiation: <obws::client::recording::Recording>::toggle_pause::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::toggle_pause::{closure#0}::{closure#0}
42
2
    }
<obws::client::recording::Recording>::toggle_pause::{closure#0}
Line
Count
Source
38
2
        self.client
39
4
            .send_message::<_, responses::OutputPaused>(Request::TogglePause)
40
4
            .await
41
2
            .map(|op| op.paused)
42
2
    }
Unexecuted instantiation: <obws::client::recording::Recording>::toggle_pause::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::toggle_pause::{closure#0}
43
44
    /// Pauses the record output.
45
1
    pub async fn pause(&self) -> Result<()> {
<obws::client::recording::Recording>::pause
Line
Count
Source
45
1
    pub async fn pause(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::recording::Recording>::pause
46
2
        
self.client.send_message(Request::Pause)1
.await
47
1
    }
<obws::client::recording::Recording>::pause::{closure#0}
Line
Count
Source
46
2
        
self.client.send_message(Request::Pause)1
.await
47
1
    }
Unexecuted instantiation: <obws::client::recording::Recording>::pause::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::pause::{closure#0}
48
49
    /// Resumes the record output.
50
1
    pub async fn resume(&self) -> Result<()> {
<obws::client::recording::Recording>::resume
Line
Count
Source
50
1
    pub async fn resume(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::recording::Recording>::resume
51
2
        
self.client.send_message(Request::Resume)1
.await
52
1
    }
<obws::client::recording::Recording>::resume::{closure#0}
Line
Count
Source
51
2
        
self.client.send_message(Request::Resume)1
.await
52
1
    }
Unexecuted instantiation: <obws::client::recording::Recording>::resume::{closure#0}
Unexecuted instantiation: <obws::client::recording::Recording>::resume::{closure#0}
53
}