mavlink_core/connection/
mod.rs1mod sync;
2
3#[cfg(feature = "transport-tcp")]
4pub mod tcp;
5
6#[cfg(feature = "transport-udp")]
7pub mod udp;
8
9#[cfg(feature = "transport-direct-serial")]
10pub mod direct_serial;
11
12pub mod file;
13
14use std::io;
15pub use sync::{Connectable, Connection, MavConnection, connect};
16
17#[cfg(any(feature = "transport-tcp", feature = "transport-udp"))]
19pub(crate) fn get_socket_addr<T: std::net::ToSocketAddrs>(
20 address: &T,
21) -> Result<std::net::SocketAddr, io::Error> {
22 address
23 .to_socket_addrs()?
24 .next()
25 .ok_or(io::Error::other("Host address lookup failed"))
26}
27
28#[cfg(feature = "tokio")]
29mod r#async;
30#[cfg(feature = "tokio")]
31pub use r#async::{AsyncConnectable, AsyncMavConnection, connect_async};