[−][src]Enum lnpbp::lnp::NodeLocator
Universal Node Locator for LNP protocol (from LNPBP-19) NB: DNS addressing is not used since it is considered insecure in terms of censorship resistance.
Variants
Native Lightning network connection: uses end-to-end encryption and runs on top of either TCP or Tor socket
URL Scheme
lnp://
UDP-based connection that uses UDP packets instead of TCP. Can't work with Tor, but may use UDP hole punching in a secure way, since the connection is still required to be encrypted.
URL Scheme
lnpu://
Local (for inter-process communication based on POSIX sockets) connection without encryption. Relies on ZMQ IPC sockets internally; specific socket pair for ZMQ is provided via query parameter
URL Schema
lnpz:
LNP protocol supports in-process communications (between threads of the same process using Mutex'es and other sync managing routines) without encryption. It relies on ZMQ IPC sockets internally. However, such connection can be done only withing the same process, and can't be represented in the form of URL. It requires presence of ZMQ context object, which can't be encoded as a string.
SHOULD be used only for DMZ area connections; otherwise
NodeLocator::Native
or [NodeLocator::Websocket
] connection
MUST be used
URL Schema
lnpz://
SHOULD be used only for DMZ area connections; otherwise
NodeLocator::Native
or [NodeLocator::Websocket
] connection
MUST be used
URL Schema
lnpz://
Text (Bech32-based) connection for high latency or non-interactive protocols. Can work with SMPT, for mesh and satellite networks – or with other mediums of communications (chat messages, QR codes etc).
URL Schema
lnpt://
Implementations
impl NodeLocator
[src]
pub fn with_port(&self, port: u16) -> Self
[src]
Adds port information to the node locator, if it can contain port.
In case if it does not, performs no action. Returns cloned Self
with
the updated data.
pub fn scheme(&self) -> String
[src]
Returns URL schema name for the given node locator type
pub fn to_url_string(&self) -> String
[src]
Returns URL string representation for a given node locator. If you need
full URL address, plsease use Url::from()
instead (this will require
url
feature for LNP/BP Core Library).
pub fn components(
&self
) -> (Option<PublicKey>, Option<InetAddr>, Option<u16>, Option<String>, Option<ZmqType>)
[src]
&self
) -> (Option<PublicKey>, Option<InetAddr>, Option<u16>, Option<String>, Option<ZmqType>)
Parses NodeLocator
into it's optional components, returned as a
single tuple of optionals:
pub fn node_id(&self) -> Option<PublicKey>
[src]
Returns node id for the given locator, if any, or Option::None
otherwise
pub fn inet_addr(&self) -> Option<InetAddr>
[src]
Returns InetAddr
for the given locator, if any, or Option::None
otherwise
pub fn port(&self) -> Option<u16>
[src]
Returns port number for the given locator, if any, or Option::None
otherwise
pub fn socket_name(&self) -> Option<String>
[src]
Returns socket name if for the given locator, if any, or
Option::None
otherwise
pub fn api_type(&self) -> Option<ZmqType>
[src]
Returns ZmqType
for the given locator, if any, or
Option::None
otherwise
Trait Implementations
impl Clone for NodeLocator
[src]
fn clone(&self) -> NodeLocator
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for NodeLocator
[src]
impl Display for NodeLocator
[src]
impl Eq for NodeLocator
[src]
impl<'_> From<&'_ NodeLocator> for Url
[src]
fn from(locator: &NodeLocator) -> Self
[src]
impl From<NodeAddr> for NodeLocator
[src]
impl FromStr for NodeLocator
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for NodeLocator
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<NodeLocator> for NodeLocator
[src]
impl TryFrom<NodeLocator> for NodeAddr
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(locator: NodeLocator) -> Result<Self, Self::Error>
[src]
impl TryFrom<Url> for NodeLocator
[src]
Auto Trait Implementations
impl RefUnwindSafe for NodeLocator
impl Send for NodeLocator
impl Sync for NodeLocator
impl Unpin for NodeLocator
impl UnwindSafe for NodeLocator
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,