pub struct WebRTCManager { /* private fields */ }Expand description
WebRTC manager handles peer discovery and connection management
Implementations§
Source§impl WebRTCManager
impl WebRTCManager
Sourcepub fn new(keys: Keys, config: WebRTCConfig) -> Self
pub fn new(keys: Keys, config: WebRTCConfig) -> Self
Create a new WebRTC manager
Sourcepub fn new_with_classifier(
keys: Keys,
config: WebRTCConfig,
classifier: PeerClassifier,
) -> Self
pub fn new_with_classifier( keys: Keys, config: WebRTCConfig, classifier: PeerClassifier, ) -> Self
Create a new WebRTC manager with a peer classifier
Sourcepub fn new_with_store(
keys: Keys,
config: WebRTCConfig,
store: Arc<dyn ContentStore>,
) -> Self
pub fn new_with_store( keys: Keys, config: WebRTCConfig, store: Arc<dyn ContentStore>, ) -> Self
Create a new WebRTC manager with a content store for serving hash requests
Sourcepub fn new_with_store_and_classifier(
keys: Keys,
config: WebRTCConfig,
store: Arc<dyn ContentStore>,
classifier: PeerClassifier,
) -> Self
pub fn new_with_store_and_classifier( keys: Keys, config: WebRTCConfig, store: Arc<dyn ContentStore>, classifier: PeerClassifier, ) -> Self
Create a new WebRTC manager with store and classifier
Sourcepub fn set_store(&mut self, store: Arc<dyn ContentStore>)
pub fn set_store(&mut self, store: Arc<dyn ContentStore>)
Set the content store for serving hash requests
Sourcepub fn set_peer_classifier(&mut self, classifier: PeerClassifier)
pub fn set_peer_classifier(&mut self, classifier: PeerClassifier)
Set the peer classifier
Sourcepub fn set_nostr_relay(&mut self, relay: Arc<NostrRelay>)
pub fn set_nostr_relay(&mut self, relay: Arc<NostrRelay>)
Set the Nostr relay for data-channel relay messages
Sourcepub fn my_peer_id(&self) -> &PeerId
pub fn my_peer_id(&self) -> &PeerId
Get my peer ID
Sourcepub fn state(&self) -> Arc<WebRTCState>
pub fn state(&self) -> Arc<WebRTCState>
Get shared state for external access
Sourcepub async fn connected_count(&self) -> usize
pub async fn connected_count(&self) -> usize
Get connected peer count
Sourcepub async fn peer_statuses(&self) -> Vec<PeerStatus>
pub async fn peer_statuses(&self) -> Vec<PeerStatus>
Get all peer statuses
Auto Trait Implementations§
impl !Freeze for WebRTCManager
impl !RefUnwindSafe for WebRTCManager
impl Send for WebRTCManager
impl Sync for WebRTCManager
impl Unpin for WebRTCManager
impl UnsafeUnpin for WebRTCManager
impl !UnwindSafe for WebRTCManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more