Coverage Report

Created: 2022-07-04 16:17

src/client/scene_collections.rs
Line
Count
Source (jump to first uncovered line)
1
use super::Client;
2
use crate::{
3
    requests::scene_collections::Request, responses::scene_collections as responses, Result,
4
};
5
6
/// API functions related to scene collections.
7
pub struct SceneCollections<'a> {
8
    pub(super) client: &'a Client,
9
}
10
11
impl<'a> SceneCollections<'a> {
12
    /// Gets an array of all scene collections.
13
1
    pub async fn list(&self) -> Result<responses::SceneCollections> {
<obws::client::scene_collections::SceneCollections>::list
Line
Count
Source
13
1
    pub async fn list(&self) -> Result<responses::SceneCollections> {
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::list
14
2
        
self.client.send_message(Request::List)1
.await
15
1
    }
<obws::client::scene_collections::SceneCollections>::list::{closure#0}
Line
Count
Source
14
2
        
self.client.send_message(Request::List)1
.await
15
1
    }
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::list::{closure#0}
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::list::{closure#0}
16
17
    /// Get the currently active scene collection name.
18
1
    pub async fn current(&self) -> Result<String> {
<obws::client::scene_collections::SceneCollections>::current
Line
Count
Source
18
1
    pub async fn current(&self) -> Result<String> {
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::current
19
1
        self.client
20
2
            .send_message::<_, responses::SceneCollections>(Request::List)
21
2
            .await
22
1
            .map(|sc| sc.current)
<obws::client::scene_collections::SceneCollections>::current::{closure#0}::{closure#0}
Line
Count
Source
22
1
            .map(|sc| sc.current)
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::current::{closure#0}::{closure#0}
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::current::{closure#0}::{closure#0}
23
1
    }
<obws::client::scene_collections::SceneCollections>::current::{closure#0}
Line
Count
Source
19
1
        self.client
20
2
            .send_message::<_, responses::SceneCollections>(Request::List)
21
2
            .await
22
1
            .map(|sc| sc.current)
23
1
    }
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::current::{closure#0}
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::current::{closure#0}
24
25
    /// Switches to a scene collection.
26
    ///
27
    /// **Note:** This will block until the collection has finished changing.
28
2
    pub async fn set_current(&self, name: &str) -> Result<()> {
<obws::client::scene_collections::SceneCollections>::set_current
Line
Count
Source
28
2
    pub async fn set_current(&self, name: &str) -> Result<()> {
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::set_current
29
4
        
self.client.send_message(Request::SetCurrent { name })2
.await
30
2
    }
<obws::client::scene_collections::SceneCollections>::set_current::{closure#0}
Line
Count
Source
29
4
        
self.client.send_message(Request::SetCurrent { name })2
.await
30
2
    }
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::set_current::{closure#0}
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::set_current::{closure#0}
31
32
    /// Creates a new scene collection, switching to it in the process.
33
    ///
34
    /// **Note:** This will block until the collection has finished changing.
35
0
    pub async fn create(&self, name: &str) -> Result<()> {
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::create
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::create
36
0
        self.client.send_message(Request::Create { name }).await
37
0
    }
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::create::{closure#0}
Unexecuted instantiation: <obws::client::scene_collections::SceneCollections>::create::{closure#0}
38
}