use_prelude!();
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,
};
pub use v3::{Peer, PresenceGraph, PresenceOs};
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
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)]
_ => {
::log::debug!("got unknown `ConnectionType`: {ffi:?}");
Self::Unknown
}
}
}
}