pub struct WebRTCState {
pub peers: Arc<RwLock<HashMap<String, PeerEntry>>>,
/* private fields */
}Expand description
WebRTC state stub - always empty when P2P is disabled
Fields§
§peers: Arc<RwLock<HashMap<String, PeerEntry>>>Implementations§
Source§impl WebRTCState
impl WebRTCState
pub fn new() -> Self
Sourcepub async fn query_peers_for_data(&self, _hash: &str) -> Option<Vec<u8>>
pub async fn query_peers_for_data(&self, _hash: &str) -> Option<Vec<u8>>
Query peers for data - always returns None when P2P is disabled
Sourcepub async fn request_from_peers(&self, _hash: &str) -> Option<Vec<u8>>
pub async fn request_from_peers(&self, _hash: &str) -> Option<Vec<u8>>
Request from peers - always returns None when P2P is disabled
Sourcepub async fn request_from_peers_with_source(
&self,
_hash: &str,
) -> Option<(Vec<u8>, String)>
pub async fn request_from_peers_with_source( &self, _hash: &str, ) -> Option<(Vec<u8>, String)>
Request from peers with source - always returns None when P2P is disabled
pub async fn record_sent(&self, peer_id: &str, bytes: u64)
pub async fn record_received(&self, peer_id: &str, bytes: u64)
Sourcepub fn get_bandwidth(&self) -> (u64, u64)
pub fn get_bandwidth(&self) -> (u64, u64)
Get bandwidth stats - always returns zeros when P2P is disabled
Sourcepub fn get_mesh_stats(&self) -> (u64, u64, u64)
pub fn get_mesh_stats(&self) -> (u64, u64, u64)
Get mesh stats - always returns zeros when P2P is disabled
Sourcepub async fn resolve_root_from_peers(
&self,
_owner_pubkey: &str,
_tree_name: &str,
_per_peer_timeout: Duration,
) -> Option<PeerRootEvent>
pub async fn resolve_root_from_peers( &self, _owner_pubkey: &str, _tree_name: &str, _per_peer_timeout: Duration, ) -> Option<PeerRootEvent>
Resolve roots from peers - always returns None when P2P is disabled
pub async fn resolve_root_from_local_buses_with_source( &self, _owner_pubkey: &str, _tree_name: &str, _timeout: Duration, ) -> Option<(&'static str, PeerRootEvent)>
Trait Implementations§
Source§impl Debug for WebRTCState
impl Debug for WebRTCState
Auto Trait Implementations§
impl !Freeze for WebRTCState
impl !RefUnwindSafe for WebRTCState
impl Send for WebRTCState
impl Sync for WebRTCState
impl Unpin for WebRTCState
impl UnsafeUnpin for WebRTCState
impl !UnwindSafe for WebRTCState
Blanket Implementations§
Source§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> 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> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> 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