pub struct WebRTCManager { /* private fields */ }Expand description
Native mesh manager handles peer discovery and transport fan-out.
Implementations§
Source§impl WebRTCManager
impl WebRTCManager
Sourcepub fn new(keys: Keys, config: WebRTCConfig) -> WebRTCManager
pub fn new(keys: Keys, config: WebRTCConfig) -> WebRTCManager
Create a new WebRTC manager
Sourcepub fn new_with_state(
keys: Keys,
config: WebRTCConfig,
state: Arc<WebRTCState>,
) -> WebRTCManager
pub fn new_with_state( keys: Keys, config: WebRTCConfig, state: Arc<WebRTCState>, ) -> WebRTCManager
Create a new WebRTC manager reusing an existing shared state object.
Sourcepub fn new_with_classifier(
keys: Keys,
config: WebRTCConfig,
classifier: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>,
) -> WebRTCManager
pub fn new_with_classifier( keys: Keys, config: WebRTCConfig, classifier: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>, ) -> WebRTCManager
Create a new WebRTC manager with a peer classifier
Sourcepub fn new_with_store(
keys: Keys,
config: WebRTCConfig,
store: Arc<dyn ContentStore>,
) -> WebRTCManager
pub fn new_with_store( keys: Keys, config: WebRTCConfig, store: Arc<dyn ContentStore>, ) -> WebRTCManager
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: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>,
) -> WebRTCManager
pub fn new_with_store_and_classifier( keys: Keys, config: WebRTCConfig, store: Arc<dyn ContentStore>, classifier: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>, ) -> WebRTCManager
Create a new WebRTC manager with store and classifier
pub fn new_with_state_and_store_and_classifier( keys: Keys, config: WebRTCConfig, state: Arc<WebRTCState>, store: Arc<dyn ContentStore>, classifier: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>, ) -> WebRTCManager
pub fn new_with_store_and_classifier_and_cashu( keys: Keys, config: WebRTCConfig, store: Arc<dyn ContentStore>, classifier: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>, cashu_routing: CashuRoutingConfig, payment_client: Option<Arc<dyn CashuPaymentClient>>, mint_metadata: Option<Arc<CashuMintMetadataStore>>, ) -> WebRTCManager
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: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>,
)
pub fn set_peer_classifier( &mut self, classifier: Arc<dyn Fn(&str) -> PeerPool + Sync + Send>, )
Set the peer classifier
Sourcepub fn set_nostr_relay(&mut self, relay: Arc<dyn MeshRelayClient>)
pub fn set_nostr_relay(&mut self, relay: Arc<dyn MeshRelayClient>)
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 fn shutdown_signal(&self) -> Arc<Sender<bool>>
pub fn shutdown_signal(&self) -> Arc<Sender<bool>>
Cloneable shutdown handle for external lifecycle control.
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