๐Ÿ“ฆ tauri-apps / tao

๐Ÿ“„ send_objects.rs ยท 30 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30// Copyright 2014-2021 The winit contributors
// Copyright 2021-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0

#[allow(dead_code)]
fn needs_send<T: Send>() {}

#[test]
fn event_loop_proxy_send() {
  #[allow(dead_code)]
  fn is_send<T: 'static + Send>() {
    // ensures that `EventLoopProxy` implements `Send`
    needs_send::<tao::event_loop::EventLoopProxy<T>>();
  }
}

#[test]
fn window_send() {
  // ensures that `Window` implements `Send`
  needs_send::<tao::window::Window>();
}

#[test]
fn ids_send() {
  // ensures that the various `..Id` types implement `Send`
  needs_send::<tao::window::WindowId>();
  needs_send::<tao::event::DeviceId>();
  needs_send::<tao::monitor::MonitorHandle>();
}