[−][src]Struct lightning_net_tokio::Connection
A connection to a remote peer. Can be constructed either as a remote connection using Connection::setup_outbound o
Methods
impl Connection
[src]
pub fn setup_inbound(
peer_manager: Arc<PeerManager<SocketDescriptor>>,
event_notify: Sender<()>,
stream: TcpStream
)
[src]
peer_manager: Arc<PeerManager<SocketDescriptor>>,
event_notify: Sender<()>,
stream: TcpStream
)
Process incoming messages and feed outgoing messages on the provided socket generated by accepting an incoming connection (by scheduling futures with tokio::spawn).
You should poll the Receive end of event_notify and call get_and_clear_pending_events() on ChannelManager and ChannelMonitor objects.
pub fn setup_outbound(
peer_manager: Arc<PeerManager<SocketDescriptor>>,
event_notify: Sender<()>,
their_node_id: PublicKey,
stream: TcpStream
)
[src]
peer_manager: Arc<PeerManager<SocketDescriptor>>,
event_notify: Sender<()>,
their_node_id: PublicKey,
stream: TcpStream
)
Process incoming messages and feed outgoing messages on the provided socket generated by making an outbound connection which is expected to be accepted by a peer with the given public key (by scheduling futures with tokio::spawn).
You should poll the Receive end of event_notify and call get_and_clear_pending_events() on ChannelManager and ChannelMonitor objects.
pub fn connect_outbound(
peer_manager: Arc<PeerManager<SocketDescriptor>>,
event_notify: Sender<()>,
their_node_id: PublicKey,
addr: SocketAddr
)
[src]
peer_manager: Arc<PeerManager<SocketDescriptor>>,
event_notify: Sender<()>,
their_node_id: PublicKey,
addr: SocketAddr
)
Process incoming messages and feed outgoing messages on a new connection made to the given socket address which is expected to be accepted by a peer with the given public key (by scheduling futures with tokio::spawn).
You should poll the Receive end of event_notify and call get_and_clear_pending_events() on ChannelManager and ChannelMonitor objects.
Auto Trait Implementations
impl Send for Connection
impl Sync for Connection
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,