use_prelude!();
use tracing::debug;
pub(crate) mod connection_request_handler;
pub(crate) mod presence;
pub(crate) mod presence_observer;
pub(crate) mod sync;
pub(crate) mod sync_state;
pub(crate) mod transport_config;
pub(crate) mod v2;
pub(crate) mod v3;
pub use presence::Presence;
pub use presence_observer::PresenceObserver;
pub use sync::TransportSync;
pub use transport_config::{
BluetoothLEConfig, Connect, Global, HttpListenConfig, LanConfig, Listen, PeerToPeer,
TcpListenConfig, TransportConfig,
};
#[doc(hidden)]
#[allow(deprecated)]
pub use v3::ConnectionType as V3ConnectionType;
pub use v3::{Connection, Peer, PresenceGraph, PresenceOs};
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConnectionType {
Bluetooth,
AccessPoint,
P2PWiFi,
WebSocket,
#[doc(hidden)]
Unknown,
}
impl ConnectionType {
fn from_ffi(ffi: ::ffi_sdk::ConnectionType) -> Self {
match ffi {
::ffi_sdk::ConnectionType::Bluetooth => Self::Bluetooth,
::ffi_sdk::ConnectionType::AccessPoint => Self::AccessPoint,
::ffi_sdk::ConnectionType::P2PWiFi => Self::P2PWiFi,
::ffi_sdk::ConnectionType::WebSocket => Self::WebSocket,
#[allow(unreachable_patterns)]
_ => {
debug!(connection_type = ?ffi, "got unknown `ConnectionType`");
Self::Unknown
}
}
}
}