Struct Client

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

pub async fn new(address: Option<BDAddr>) -> Result<Self, Box<dyn Error>>

Examples found in repository?
examples/example.rs (line 29)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn run(&mut self)

Examples found in repository?
examples/example.rs (line 30)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn register_air_gesture_events(&self, listener: fn(Uuid, AirGestures))

Examples found in repository?
examples/example.rs (line 32)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn register_tap_events(&self, listener: fn(Uuid, u8))

Examples found in repository?
examples/example.rs (line 33)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn register_raw_data_events(&self, listener: fn(Uuid, Vec<u8>))

Examples found in repository?
examples/example.rs (line 34)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn register_mouse_events(&self, listener: fn(Uuid, i16, i16, bool))

Examples found in repository?
examples/example.rs (line 35)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn register_air_gesture_state_events(&self, listener: fn(Uuid, bool))

Examples found in repository?
examples/example.rs (line 36)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn set_input_mode( &mut self, mode: InputMode, sensitivity: Option<Vec<u8>>, )

Examples found in repository?
examples/example.rs (line 39)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn set_input_type(&mut self, input_type: InputType)

Examples found in repository?
examples/example.rs (line 43)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}
Source

pub async fn set_mouse_mode(&self, mouse_mode: MouseModes)

Source

pub async fn send_vibration_sequence(&self, sequence: Vec<u16>)

Examples found in repository?
examples/example.rs (line 63)
28async fn main() {
29    let mut tap_client = tap_sdk::Client::new(None).await.unwrap();
30    tap_client.run().await;
31
32    tap_client.register_air_gesture_events(on_gesture).await;
33    tap_client.register_tap_events(on_tapped).await;
34    tap_client.register_raw_data_events(on_raw_data).await;
35    tap_client.register_mouse_events(on_moused).await;
36    tap_client.register_air_gesture_state_events(on_mouse_mode_change).await;
37
38    println!("Setting Controller Mode for 5 seconds...");
39    tap_client.set_input_mode(InputMode::Controller, None).await;
40    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
41
42    println!("Setting Auto Mode for 5 seconds...");
43    tap_client.set_input_type(InputType::Auto).await;
44    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
45
46    println!("Setting forced Mouse Mode for 5 seconds...");
47    tap_client.set_input_type(InputType::Mouse).await;
48    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
49    
50    println!("Setting forced Keyboard Mode for 5 seconds...");
51    tap_client.set_input_type(InputType::Keyboard).await;
52    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
53
54    println!("Setting Text Mode for 5 seconds...");
55    tap_client.set_input_mode(InputMode::Text, None).await;
56    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
57
58    println!("Setting Controller and Text Mode for 5 seconds...");
59    tap_client.set_input_mode(InputMode::ControllerText, None).await;
60    tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
61
62    println!("Testing vibration feedback...");
63    tap_client.send_vibration_sequence(vec![100, 200, 100, 200, 500]).await;
64    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
65
66    println!("Returning to Auto Mode for normal operation...");
67    tap_client.set_input_type(InputType::Auto).await;
68    tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
69
70    println!("Listening for events. Press Ctrl+C to exit.");
71    tokio::signal::ctrl_c().await.unwrap();
72}

Trait Implementations§

Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.