Coverage Report

Created: 2022-07-04 16:17

src/client/media_inputs.rs
Line
Count
Source
1
use time::Duration;
2
3
use super::Client;
4
use crate::{
5
    common::MediaAction, requests::media_inputs::Request, responses::media_inputs as responses,
6
    Result,
7
};
8
9
/// API functions related to media inputs.
10
pub struct MediaInputs<'a> {
11
    pub(super) client: &'a Client,
12
}
13
14
impl<'a> MediaInputs<'a> {
15
    /// Gets the status of a media input.
16
1
    pub async fn status(&self, input: &str) -> Result<responses::MediaStatus> {
<obws::client::media_inputs::MediaInputs>::status
Line
Count
Source
16
1
    pub async fn status(&self, input: &str) -> Result<responses::MediaStatus> {
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::status
17
2
        
self.client.send_message(Request::Status { input })1
.await
18
1
    }
<obws::client::media_inputs::MediaInputs>::status::{closure#0}
Line
Count
Source
17
2
        
self.client.send_message(Request::Status { input })1
.await
18
1
    }
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::status::{closure#0}
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::status::{closure#0}
19
20
    /// Sets the cursor position of a media input.
21
    ///
22
    /// This request does not perform bounds checking of the cursor position.
23
1
    pub async fn set_cursor(&self, input: &str, cursor: Duration) -> Result<()> {
<obws::client::media_inputs::MediaInputs>::set_cursor
Line
Count
Source
23
1
    pub async fn set_cursor(&self, input: &str, cursor: Duration) -> Result<()> {
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::set_cursor
24
1
        self.client
25
2
            .send_message(Request::SetCursor { input, cursor })
26
2
            .await
27
1
    }
<obws::client::media_inputs::MediaInputs>::set_cursor::{closure#0}
Line
Count
Source
24
1
        self.client
25
2
            .send_message(Request::SetCursor { input, cursor })
26
2
            .await
27
1
    }
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::set_cursor::{closure#0}
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::set_cursor::{closure#0}
28
29
    /// Offsets the current cursor position of a media input by the specified value.
30
    ///
31
    /// This request does not perform bounds checking of the cursor position.
32
1
    pub async fn offset_cursor(&self, input: &str, offset: Duration) -> Result<()> {
<obws::client::media_inputs::MediaInputs>::offset_cursor
Line
Count
Source
32
1
    pub async fn offset_cursor(&self, input: &str, offset: Duration) -> Result<()> {
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::offset_cursor
33
1
        self.client
34
2
            .send_message(Request::OffsetCursor { input, offset })
35
2
            .await
36
1
    }
<obws::client::media_inputs::MediaInputs>::offset_cursor::{closure#0}
Line
Count
Source
33
1
        self.client
34
2
            .send_message(Request::OffsetCursor { input, offset })
35
2
            .await
36
1
    }
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::offset_cursor::{closure#0}
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::offset_cursor::{closure#0}
37
38
    /// Triggers an action on a media input.
39
1
    pub async fn trigger_action(&self, input: &str, action: MediaAction) -> Result<()> {
<obws::client::media_inputs::MediaInputs>::trigger_action
Line
Count
Source
39
1
    pub async fn trigger_action(&self, input: &str, action: MediaAction) -> Result<()> {
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::trigger_action
40
1
        self.client
41
2
            .send_message(Request::TriggerAction { input, action })
42
2
            .await
43
1
    }
<obws::client::media_inputs::MediaInputs>::trigger_action::{closure#0}
Line
Count
Source
40
1
        self.client
41
2
            .send_message(Request::TriggerAction { input, action })
42
2
            .await
43
1
    }
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::trigger_action::{closure#0}
Unexecuted instantiation: <obws::client::media_inputs::MediaInputs>::trigger_action::{closure#0}
44
}