pub struct Hub { /* private fields */ }Expand description
A signal server connection from which we can establish tx5 connections.
Implementations§
Source§impl Hub
impl Hub
Sourcepub async fn new(
webrtc_config: WebRtcConfig,
url: &str,
config: Arc<HubConfig>,
) -> Result<(Self, HubRecv)>
pub async fn new( webrtc_config: WebRtcConfig, url: &str, config: Arc<HubConfig>, ) -> Result<(Self, HubRecv)>
Create a new Hub based off a connected tx5 signal client. Note, if this is not a “listener” client, you do not need to ever call accept.
Sourcepub async fn connect(&self, pub_key: PubKey) -> Result<(Arc<Conn>, ConnRecv)>
pub async fn connect(&self, pub_key: PubKey) -> Result<(Arc<Conn>, ConnRecv)>
Establish a connection to a remote peer.
Sourcepub fn set_webrtc_config(&self, webrtc_config: WebRtcConfig)
pub fn set_webrtc_config(&self, webrtc_config: WebRtcConfig)
Alter the webrtc_config at runtime.
This will affect all future new outgoing connections, and all connections accepted on the receiver. It will not affect any connections already established.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hub
impl !RefUnwindSafe for Hub
impl Send for Hub
impl Sync for Hub
impl Unpin for Hub
impl !UnwindSafe for Hub
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more