Coverage Report

Created: 2022-07-04 16:17

src/client/replay_buffer.rs
Line
Count
Source
1
use super::Client;
2
use crate::{requests::replay_buffer::Request, responses::replay_buffer as responses, Result};
3
4
/// API functions related to the replay buffer.
5
pub struct ReplayBuffer<'a> {
6
    pub(super) client: &'a Client,
7
}
8
9
impl<'a> ReplayBuffer<'a> {
10
    /// Gets the status of the replay buffer output.
11
19
    pub async fn status(&self) -> Result<bool> {
<obws::client::replay_buffer::ReplayBuffer>::status
Line
Count
Source
11
19
    pub async fn status(&self) -> Result<bool> {
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::status
12
19
        self.client
13
38
            .send_message::<_, responses::OutputActive>(Request::Status)
14
38
            .await
15
19
            .map(|oa| oa.active)
<obws::client::replay_buffer::ReplayBuffer>::status::{closure#0}::{closure#0}
Line
Count
Source
15
19
            .map(|oa| oa.active)
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::status::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::status::{closure#0}::{closure#0}
16
19
    }
<obws::client::replay_buffer::ReplayBuffer>::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::replay_buffer::ReplayBuffer>::status::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::status::{closure#0}
17
18
    /// Toggles the state of the replay buffer output.
19
2
    pub async fn toggle(&self) -> Result<bool> {
<obws::client::replay_buffer::ReplayBuffer>::toggle
Line
Count
Source
19
2
    pub async fn toggle(&self) -> Result<bool> {
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::toggle
20
2
        self.client
21
4
            .send_message::<_, responses::OutputActive>(Request::Toggle)
22
4
            .await
23
2
            .map(|oa| oa.active)
<obws::client::replay_buffer::ReplayBuffer>::toggle::{closure#0}::{closure#0}
Line
Count
Source
23
2
            .map(|oa| oa.active)
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::toggle::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::toggle::{closure#0}::{closure#0}
24
2
    }
<obws::client::replay_buffer::ReplayBuffer>::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::replay_buffer::ReplayBuffer>::toggle::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::toggle::{closure#0}
25
26
    /// Starts the replay buffer output.
27
1
    pub async fn start(&self) -> Result<()> {
<obws::client::replay_buffer::ReplayBuffer>::start
Line
Count
Source
27
1
    pub async fn start(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::start
28
2
        
self.client.send_message(Request::Start)1
.await
29
1
    }
<obws::client::replay_buffer::ReplayBuffer>::start::{closure#0}
Line
Count
Source
28
2
        
self.client.send_message(Request::Start)1
.await
29
1
    }
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::start::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::start::{closure#0}
30
31
    /// Stops the replay buffer output.
32
1
    pub async fn stop(&self) -> Result<()> {
<obws::client::replay_buffer::ReplayBuffer>::stop
Line
Count
Source
32
1
    pub async fn stop(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::stop
33
2
        
self.client.send_message(Request::Stop)1
.await
34
1
    }
<obws::client::replay_buffer::ReplayBuffer>::stop::{closure#0}
Line
Count
Source
33
2
        
self.client.send_message(Request::Stop)1
.await
34
1
    }
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::stop::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::stop::{closure#0}
35
36
    /// Saves the contents of the replay buffer output.
37
1
    pub async fn save(&self) -> Result<()> {
<obws::client::replay_buffer::ReplayBuffer>::save
Line
Count
Source
37
1
    pub async fn save(&self) -> Result<()> {
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::save
38
2
        
self.client.send_message(Request::Save)1
.await
39
1
    }
<obws::client::replay_buffer::ReplayBuffer>::save::{closure#0}
Line
Count
Source
38
2
        
self.client.send_message(Request::Save)1
.await
39
1
    }
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::save::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::save::{closure#0}
40
41
    /// Gets the file name of the last replay buffer save file.
42
1
    pub async fn last_replay(&self) -> Result<String> {
<obws::client::replay_buffer::ReplayBuffer>::last_replay
Line
Count
Source
42
1
    pub async fn last_replay(&self) -> Result<String> {
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::last_replay
43
1
        self.client
44
2
            .send_message::<_, responses::SavedReplayPath>(Request::LastReplay)
45
2
            .await
46
1
            .map(|srp| srp.saved_replay_path)
<obws::client::replay_buffer::ReplayBuffer>::last_replay::{closure#0}::{closure#0}
Line
Count
Source
46
1
            .map(|srp| srp.saved_replay_path)
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::last_replay::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::last_replay::{closure#0}::{closure#0}
47
1
    }
<obws::client::replay_buffer::ReplayBuffer>::last_replay::{closure#0}
Line
Count
Source
43
1
        self.client
44
2
            .send_message::<_, responses::SavedReplayPath>(Request::LastReplay)
45
2
            .await
46
1
            .map(|srp| srp.saved_replay_path)
47
1
    }
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::last_replay::{closure#0}
Unexecuted instantiation: <obws::client::replay_buffer::ReplayBuffer>::last_replay::{closure#0}
48
}