[−][src]Struct cjdns_snode::peer::Peers
Fields
peers: PeerList
anns: Mutex<AnnList>
msg_id_seq: Seq
announce_tx: Sender<Vec<u8>>
Implementations
impl Peers
[src]
impl Peers
[src]
const DROP_AFTER: Duration
[src]
const PING_AFTER: Duration
[src]
const PING_CYCLE: Duration
[src]
pub async fn ping_task<'_>(&'_ self)
[src]
async fn do_pings<'_>(&'_ self)
[src]
impl Peers
[src]
impl Peers
[src]
fn new(ann_tx: Sender<Vec<u8>>) -> Self
[src]
Create new instance of Peers + announce sender
pub async fn connect_to<'_>(&'_ self, uri: Uri)
[src]
Asynchronously start connecting to the specified peer supernode. If the connection can't be established or closed by the remote side, it will be reconnected automatically after a delay.
pub async fn accept_incoming_connection<'_>(
&'_ self,
from_ipv6: String,
ws_stream: impl WebSock
) -> Result<(), Error>
[src]
&'_ self,
from_ipv6: String,
ws_stream: impl WebSock
) -> Result<(), Error>
pub async fn add_ann<'_>(&'_ self, hash: AnnHash, binary: Vec<u8>)
[src]
pub fn del_ann(&self, hash: &AnnHash)
[src]
async fn incoming<'_>(
&'_ self,
addr: String,
ws_stream: impl WebSock
) -> Result<(), Error>
[src]
&'_ self,
addr: String,
ws_stream: impl WebSock
) -> Result<(), Error>
Handle incoming WebSocket connection and process it until closed. This async fn completes when the connection is closed, so spawn a task for it.
async fn outgoing<'_>(
&'_ self,
addr: String,
ws_stream: impl WebSock
) -> Result<(), Error>
[src]
&'_ self,
addr: String,
ws_stream: impl WebSock
) -> Result<(), Error>
Handle outgoing WebSocket connection and process it until closed. This async fn completes when the connection is closed, so spawn a task for it.
fn create_peer<'a>(
&'a self,
addr: String,
ws_stream: impl WebSock + 'a,
peer_type: PeerType
) -> (Peer, impl Future<Output = Result<(), Error>> + 'a)
[src]
&'a self,
addr: String,
ws_stream: impl WebSock + 'a,
peer_type: PeerType
) -> (Peer, impl Future<Output = Result<(), Error>> + 'a)
fn drop_peer(&self, peer: Peer)
[src]
async fn run_websocket<'_>(
&'_ self,
peer: Peer,
ws_stream: impl WebSock,
msg_rx: Receiver<Message>,
ann_tx: Sender<Vec<u8>>
) -> Result<(), Error>
[src]
&'_ self,
peer: Peer,
ws_stream: impl WebSock,
msg_rx: Receiver<Message>,
ann_tx: Sender<Vec<u8>>
) -> Result<(), Error>
async fn handle_message<'_, '_>(
&'_ self,
peer: Peer,
message: Message,
ann_tx: &'_ mut Sender<Vec<u8>>
) -> Result<(), Error>
[src]
&'_ self,
peer: Peer,
message: Message,
ann_tx: &'_ mut Sender<Vec<u8>>
) -> Result<(), Error>
Auto Trait Implementations
impl !RefUnwindSafe for Peers
impl Send for Peers
impl Sync for Peers
impl Unpin for Peers
impl !UnwindSafe for Peers
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,