diff --git a/pr/2960/docs/iroh/client/net/index.html b/pr/2960/docs/iroh/client/net/index.html index 22d8e474f0..73b9694547 100644 --- a/pr/2960/docs/iroh/client/net/index.html +++ b/pr/2960/docs/iroh/client/net/index.html @@ -1,4 +1,4 @@ -iroh::client::net - Rust

Module iroh::client::net

Expand description

API to manage the iroh networking stack.

+iroh::client::net - Rust

Module iroh::client::net

source ·
Expand description

API to manage the iroh networking stack.

The main entry point is the Client.

The client can be used to get information about the node, such as the node id or node address.

diff --git a/pr/2960/docs/iroh/client/net/struct.Client.html b/pr/2960/docs/iroh/client/net/struct.Client.html index 467df9944d..3f95df4a1e 100644 --- a/pr/2960/docs/iroh/client/net/struct.Client.html +++ b/pr/2960/docs/iroh/client/net/struct.Client.html @@ -1,30 +1,30 @@ -Client in iroh::client::net - Rust

Struct iroh::client::net::Client

pub struct Client { /* private fields */ }
Expand description

Iroh net Client.

+Client in iroh::client::net - Rust

Struct iroh::client::net::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Iroh net Client.

Cheaply clonable and threadsafe. Use the iroh net::Client to access the iroh net methods from a different thread, process, or remote machine.

The node::Client api allows you to get information about the iroh node, its status, and connection status to other nodes. It also allows you to provide address information about other nodes to your node.

-

Implementations§

§

impl Client

pub fn new(rpc: RpcClient<RpcService>) -> Client

Creates a new net client

-

pub async fn remote_info_iter( +

Implementations§

source§

impl Client

source

pub fn new(rpc: RpcClient<RpcService>) -> Client

Creates a new net client

+
source

pub async fn remote_info_iter( &self ) -> Result<impl Stream<Item = Result<RemoteInfo, Error>>, Error>

Fetches information about currently known remote nodes.

This streams a current snapshot. It does not keep the stream open after finishing transferring the snapshot.

See also Endpoint::remote_info_iter.

-

pub async fn remote_info( +

source

pub async fn remote_info( &self, node_id: PublicKey ) -> Result<Option<RemoteInfo>, Error>

Fetches node information about a remote iroh node identified by its NodeId.

See also Endpoint::remote_info.

-

pub async fn node_id(&self) -> Result<PublicKey, Error>

Fetches the node id of this node.

+
source

pub async fn node_id(&self) -> Result<PublicKey, Error>

Fetches the node id of this node.

See also Endpoint::node_id.

-

pub async fn node_addr(&self) -> Result<NodeAddr, Error>

Fetches the NodeAddr for this node.

+
source

pub async fn node_addr(&self) -> Result<NodeAddr, Error>

Fetches the NodeAddr for this node.

See also Endpoint::node_addr.

-

pub async fn add_node_addr(&self, addr: NodeAddr) -> Result<(), Error>

Adds a known node address to this node.

+
source

pub async fn add_node_addr(&self, addr: NodeAddr) -> Result<(), Error>

Adds a known node address to this node.

See also Endpoint::add_node_addr.

-

pub async fn home_relay(&self) -> Result<Option<RelayUrl>, Error>

Returns the relay server we are connected to.

+
source

pub async fn home_relay(&self) -> Result<Option<RelayUrl>, Error>

Returns the relay server we are connected to.

See also Endpoint::home_relay.

-

Trait Implementations§

§

impl Clone for Client

§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Client

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh/client/net/struct.NodeStatus.html b/pr/2960/docs/iroh/client/net/struct.NodeStatus.html index 3746dc33cf..e292c4a005 100644 --- a/pr/2960/docs/iroh/client/net/struct.NodeStatus.html +++ b/pr/2960/docs/iroh/client/net/struct.NodeStatus.html @@ -1,4 +1,4 @@ -NodeStatus in iroh::client::net - Rust

Struct iroh::client::net::NodeStatus

pub struct NodeStatus {
+NodeStatus in iroh::client::net - Rust

Struct iroh::client::net::NodeStatus

source ·
pub struct NodeStatus {
     pub addr: NodeAddr,
     pub listen_addrs: Vec<SocketAddr>,
     pub version: String,
@@ -8,10 +8,10 @@
 
§listen_addrs: Vec<SocketAddr>

The bound listening addresses of the node

§version: String

The version of the node

§rpc_addr: Option<SocketAddr>

RPC address, if currently listening.

-

Trait Implementations§

§

impl Debug for NodeStatus

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeStatus

§

fn deserialize<__D>( +

Trait Implementations§

source§

impl Debug for NodeStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeStatus

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<NodeStatus, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for NodeStatus

§

fn serialize<__S>( + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for NodeStatus

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where diff --git a/pr/2960/docs/iroh/client/node/index.html b/pr/2960/docs/iroh/client/node/index.html index c786bf619f..745af1a938 100644 --- a/pr/2960/docs/iroh/client/node/index.html +++ b/pr/2960/docs/iroh/client/node/index.html @@ -1,3 +1,3 @@ -iroh::client::node - Rust

Module iroh::client::node

Expand description

Client to interact with an iroh node.

+iroh::client::node - Rust

Module iroh::client::node

source ·
Expand description

Client to interact with an iroh node.

The main entry point is Client.

Structs§

  • Client to interact with an iroh node.
\ No newline at end of file diff --git a/pr/2960/docs/iroh/client/node/struct.Client.html b/pr/2960/docs/iroh/client/node/struct.Client.html index 3656725d28..84323ebb87 100644 --- a/pr/2960/docs/iroh/client/node/struct.Client.html +++ b/pr/2960/docs/iroh/client/node/struct.Client.html @@ -1,11 +1,11 @@ -Client in iroh::client::node - Rust

Struct iroh::client::node::Client

pub struct Client { /* private fields */ }
Expand description

Client to interact with an iroh node.

-

Implementations§

§

impl Client

pub fn new(rpc: RpcClient<RpcService>) -> Client

Creates a new node client

-

pub async fn shutdown(&self, force: bool) -> Result<(), Error>

Shuts down the node.

+Client in iroh::client::node - Rust

Struct iroh::client::node::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Client to interact with an iroh node.

+

Implementations§

source§

impl Client

source

pub fn new(rpc: RpcClient<RpcService>) -> Client

Creates a new node client

+
source

pub async fn shutdown(&self, force: bool) -> Result<(), Error>

Shuts down the node.

If force is true, the node will be shut down instantly without waiting for things to stop gracefully.

-

pub async fn stats(&self) -> Result<BTreeMap<String, CounterStats>, Error>

Fetches statistics of the running node.

-

pub async fn status(&self) -> Result<NodeStatus, Error>

Fetches status information about this node.

-

Trait Implementations§

§

impl Clone for Client

§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Client

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where +

source

pub async fn stats(&self) -> Result<BTreeMap<String, CounterStats>, Error>

Fetches statistics of the running node.

+
source

pub async fn status(&self) -> Result<NodeStatus, Error>

Fetches status information about this node.

+

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh/metrics/fn.get_metrics.html b/pr/2960/docs/iroh/metrics/fn.get_metrics.html index a2a237c55d..332d201791 100644 --- a/pr/2960/docs/iroh/metrics/fn.get_metrics.html +++ b/pr/2960/docs/iroh/metrics/fn.get_metrics.html @@ -1,3 +1,3 @@ -get_metrics in iroh::metrics - Rust

Function iroh::metrics::get_metrics

source ·
pub fn get_metrics() -> Result<BTreeMap<String, CounterStats>>
Available on crate feature metrics only.
Expand description

Collect the current metrics into a hash map.

+get_metrics in iroh::metrics - Rust

Function iroh::metrics::get_metrics

source ·
pub fn get_metrics() -> Result<BTreeMap<String, CounterStats>>
Available on crate feature metrics only.
Expand description

Collect the current metrics into a hash map.

TODO: Only counters are supported for now, other metrics will be skipped without error.

\ No newline at end of file diff --git a/pr/2960/docs/iroh/router/index.html b/pr/2960/docs/iroh/router/index.html index d672df6dec..d80583840c 100644 --- a/pr/2960/docs/iroh/router/index.html +++ b/pr/2960/docs/iroh/router/index.html @@ -1 +1 @@ -iroh::router - Rust

Crate iroh::router

source ·

Structs§

Traits§

\ No newline at end of file +iroh::router - Rust

Crate iroh::router

Structs§

Traits§

\ No newline at end of file diff --git a/pr/2960/docs/iroh/router/struct.ProtocolMap.html b/pr/2960/docs/iroh/router/struct.ProtocolMap.html index 3d29b1d5f4..1d112c7ce0 100644 --- a/pr/2960/docs/iroh/router/struct.ProtocolMap.html +++ b/pr/2960/docs/iroh/router/struct.ProtocolMap.html @@ -1,12 +1,12 @@ -ProtocolMap in iroh::router - Rust

Struct iroh::router::ProtocolMap

source ·
pub struct ProtocolMap(/* private fields */);
Expand description

A typed map of protocol handlers, mapping them from ALPNs.

-

Implementations§

source§

impl ProtocolMap

source

pub fn get_typed<P>(&self, alpn: &[u8]) -> Option<Arc<P>>
where +ProtocolMap in iroh::router - Rust

Struct iroh::router::ProtocolMap

pub struct ProtocolMap(/* private fields */);
Expand description

A typed map of protocol handlers, mapping them from ALPNs.

+

Implementations§

§

impl ProtocolMap

pub fn get_typed<P>(&self, alpn: &[u8]) -> Option<Arc<P>>
where P: ProtocolHandler,

Returns the registered protocol handler for an ALPN as a concrete type.

-
source

pub fn get(&self, alpn: &[u8]) -> Option<Arc<dyn ProtocolHandler>>

Returns the registered protocol handler for an ALPN as a Arc<dyn ProtocolHandler>.

-
source

pub fn insert(&mut self, alpn: Vec<u8>, handler: Arc<dyn ProtocolHandler>)

Inserts a protocol handler.

-
source

pub fn alpns(&self) -> impl Iterator<Item = &Vec<u8>>

Returns an iterator of all registered ALPN protocol identifiers.

-
source

pub async fn shutdown(&self)

Shuts down all protocol handlers.

+

pub fn get(&self, alpn: &[u8]) -> Option<Arc<dyn ProtocolHandler>>

Returns the registered protocol handler for an ALPN as a Arc<dyn ProtocolHandler>.

+

pub fn insert(&mut self, alpn: Vec<u8>, handler: Arc<dyn ProtocolHandler>)

Inserts a protocol handler.

+

pub fn alpns(&self) -> impl Iterator<Item = &Vec<u8>>

Returns an iterator of all registered ALPN protocol identifiers.

+

pub async fn shutdown(&self)

Shuts down all protocol handlers.

Calls and awaits ProtocolHandler::shutdown for all registered handlers concurrently.

-

Trait Implementations§

source§

impl Clone for ProtocolMap

source§

fn clone(&self) -> ProtocolMap

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProtocolMap

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for ProtocolMap

source§

fn default() -> ProtocolMap

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

§

impl Clone for ProtocolMap

§

fn clone(&self) -> ProtocolMap

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ProtocolMap

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for ProtocolMap

§

fn default() -> ProtocolMap

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh/router/struct.Router.html b/pr/2960/docs/iroh/router/struct.Router.html index 6649757e5d..7e3d70f56a 100644 --- a/pr/2960/docs/iroh/router/struct.Router.html +++ b/pr/2960/docs/iroh/router/struct.Router.html @@ -1,8 +1,8 @@ -Router in iroh::router - Rust

Struct iroh::router::Router

source ·
pub struct Router { /* private fields */ }

Implementations§

source§

impl Router

source

pub fn builder(endpoint: Endpoint) -> RouterBuilder

source

pub fn get_protocol<P>(&self, alpn: &[u8]) -> Option<Arc<P>>
where +Router in iroh::router - Rust

Struct iroh::router::Router

pub struct Router { /* private fields */ }

Implementations§

§

impl Router

pub fn builder(endpoint: Endpoint) -> RouterBuilder

pub fn get_protocol<P>(&self, alpn: &[u8]) -> Option<Arc<P>>
where P: ProtocolHandler,

Returns a protocol handler for an ALPN.

This downcasts to the concrete type and returns None if the handler registered for alpn does not match the passed type.

-
source

pub fn endpoint(&self) -> &Endpoint

source

pub async fn shutdown(self) -> Result<(), Error>

Trait Implementations§

source§

impl Clone for Router

source§

fn clone(&self) -> Router

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Router

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Router

§

impl !RefUnwindSafe for Router

§

impl Send for Router

§

impl Sync for Router

§

impl Unpin for Router

§

impl !UnwindSafe for Router

Blanket Implementations§

source§

impl<T> Any for T
where +

pub fn endpoint(&self) -> &Endpoint

pub async fn shutdown(self) -> Result<(), Error>

Trait Implementations§

§

impl Clone for Router

§

fn clone(&self) -> Router

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Router

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Router

§

impl !RefUnwindSafe for Router

§

impl Send for Router

§

impl Sync for Router

§

impl Unpin for Router

§

impl !UnwindSafe for Router

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh/router/struct.RouterBuilder.html b/pr/2960/docs/iroh/router/struct.RouterBuilder.html index 7c6697ee56..3bfe8e6a13 100644 --- a/pr/2960/docs/iroh/router/struct.RouterBuilder.html +++ b/pr/2960/docs/iroh/router/struct.RouterBuilder.html @@ -1,13 +1,13 @@ -RouterBuilder in iroh::router - Rust

Struct iroh::router::RouterBuilder

source ·
pub struct RouterBuilder { /* private fields */ }

Implementations§

source§

impl RouterBuilder

source

pub fn new(endpoint: Endpoint) -> RouterBuilder

source

pub fn accept( +RouterBuilder in iroh::router - Rust

Struct iroh::router::RouterBuilder

pub struct RouterBuilder { /* private fields */ }

Implementations§

§

impl RouterBuilder

pub fn new(endpoint: Endpoint) -> RouterBuilder

pub fn accept( self, alpn: impl AsRef<[u8]>, handler: Arc<dyn ProtocolHandler> -) -> RouterBuilder

source

pub fn endpoint(&self) -> &Endpoint

Returns the Endpoint of the node.

-
source

pub fn get_protocol<P>(&self, alpn: &[u8]) -> Option<Arc<P>>
where +) -> RouterBuilder

pub fn endpoint(&self) -> &Endpoint

Returns the Endpoint of the node.

+

pub fn get_protocol<P>(&self, alpn: &[u8]) -> Option<Arc<P>>
where P: ProtocolHandler,

Returns a protocol handler for an ALPN.

This downcasts to the concrete type and returns None if the handler registered for alpn does not match the passed type.

-
source

pub async fn spawn(self) -> Result<Router, Error>

Trait Implementations§

source§

impl Debug for RouterBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

pub async fn spawn(self) -> Result<Router, Error>

Trait Implementations§

§

impl Debug for RouterBuilder

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh/router/trait.ProtocolHandler.html b/pr/2960/docs/iroh/router/trait.ProtocolHandler.html index b1fb417ab6..6135bdb3f1 100644 --- a/pr/2960/docs/iroh/router/trait.ProtocolHandler.html +++ b/pr/2960/docs/iroh/router/trait.ProtocolHandler.html @@ -1,4 +1,4 @@ -ProtocolHandler in iroh::router - Rust

Trait iroh::router::ProtocolHandler

source ·
pub trait ProtocolHandler: Send + Sync + IntoArcAny + Debug + 'static {
+ProtocolHandler in iroh::router - Rust

Trait iroh::router::ProtocolHandler

pub trait ProtocolHandler: Send + Sync + IntoArcAny + Debug + 'static {
     // Required method
     fn accept(
         self: Arc<Self>,
@@ -13,10 +13,10 @@
 

Implement this trait on a struct that should handle incoming connections. The protocol handler must then be registered on the node for an ALPN protocol with crate::RouterBuilder::accept.

-

Required Methods§

Required Methods§

fn accept( self: Arc<Self>, conn: Connecting ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>

Handle an incoming connection.

This runs on a freshly spawned tokio task so this can be long-running.

-

Provided Methods§

source

fn shutdown(self: Arc<Self>) -> Pin<Box<dyn Future<Output = ()> + Send>>

Called when the node shuts down.

+

Provided Methods§

fn shutdown(self: Arc<Self>) -> Pin<Box<dyn Future<Output = ()> + Send>>

Called when the node shuts down.

Implementors§

\ No newline at end of file diff --git a/pr/2960/docs/iroh_net/endpoint/struct.AddrInfo.html b/pr/2960/docs/iroh_net/endpoint/struct.AddrInfo.html index c195611ca8..7b2333392f 100644 --- a/pr/2960/docs/iroh_net/endpoint/struct.AddrInfo.html +++ b/pr/2960/docs/iroh_net/endpoint/struct.AddrInfo.html @@ -1,4 +1,4 @@ -AddrInfo in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::AddrInfo

pub struct AddrInfo {
+AddrInfo in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::AddrInfo

source ·
pub struct AddrInfo {
     pub relay_url: Option<RelayUrl>,
     pub direct_addresses: BTreeSet<SocketAddr>,
 }
Expand description

Network paths to contact an iroh-net node.

@@ -7,26 +7,26 @@ Unless a [discovery service] is used at least one path is required to connect to other node, see NodeAddr for details.

Fields§

§relay_url: Option<RelayUrl>

The node’s home relay url.

§direct_addresses: BTreeSet<SocketAddr>

Socket addresses where the peer might be reached directly.

-

Implementations§

§

impl AddrInfo

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+

Implementations§

source§

impl AddrInfo

source

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in ab AddrInfo received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

Trait Implementations§

§

impl Clone for AddrInfo

§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for AddrInfo

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AddrInfo

§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for AddrInfo

§

fn deserialize<__D>( +

Trait Implementations§

source§

impl Clone for AddrInfo

source§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddrInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for AddrInfo

source§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AddrInfo

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<AddrInfo, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl Ord for AddrInfo

§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl Ord for AddrInfo

source§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for AddrInfo

§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for AddrInfo

source§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for AddrInfo

§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AddrInfo

source§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for AddrInfo

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for AddrInfo

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for AddrInfo

§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

§

impl Freeze for AddrInfo

§

impl RefUnwindSafe for AddrInfo

§

impl Send for AddrInfo

§

impl Sync for AddrInfo

§

impl Unpin for AddrInfo

§

impl UnwindSafe for AddrInfo

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for AddrInfo

source§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

§

impl Freeze for AddrInfo

§

impl RefUnwindSafe for AddrInfo

§

impl Send for AddrInfo

§

impl Sync for AddrInfo

§

impl Unpin for AddrInfo

§

impl UnwindSafe for AddrInfo

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/endpoint/struct.NodeAddr.html b/pr/2960/docs/iroh_net/endpoint/struct.NodeAddr.html index 6983a09d92..5761e1de53 100644 --- a/pr/2960/docs/iroh_net/endpoint/struct.NodeAddr.html +++ b/pr/2960/docs/iroh_net/endpoint/struct.NodeAddr.html @@ -1,4 +1,4 @@ -NodeAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::NodeAddr

pub struct NodeAddr {
+NodeAddr in iroh_net::endpoint - Rust

Struct iroh_net::endpoint::NodeAddr

source ·
pub struct NodeAddr {
     pub node_id: PublicKey,
     pub info: AddrInfo,
 }
Expand description

Network-level addressing information for an iroh-net node.

@@ -25,40 +25,40 @@ number of network-level addressing information. It is a generic addressing type whenever a connection to other nodes needs to be established.

Fields§

§node_id: PublicKey

The node’s identifier.

§info: AddrInfo

Addressing information to connect to Self::node_id.

-

Implementations§

§

impl NodeAddr

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

-

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

-

pub fn with_direct_addresses( +

Implementations§

source§

impl NodeAddr

source

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

+
source

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

+
source

pub fn with_direct_addresses( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Adds the given direct addresses to the peer’s AddrInfo.

-

pub fn from_parts( +

source

pub fn from_parts( node_id: PublicKey, relay_url: Option<RelayUrl>, direct_addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Creates a new NodeAddr from its parts.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in a NodeAddr received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

-

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

-

Trait Implementations§

§

impl Clone for NodeAddr

§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NodeAddr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeAddr

§

fn deserialize<__D>( +

source

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

+
source

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

+

Trait Implementations§

source§

impl Clone for NodeAddr

source§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeAddr

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeTicket

§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

-
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl From<NodeTicket> for NodeAddr

§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

-
§

impl From<PublicKey> for NodeAddr

§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
source§

impl From<RemoteInfo> for NodeAddr

source§

fn from(info: RemoteInfo) -> Self

Converts to this type from the input type.
§

impl Ord for NodeAddr

§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

source§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
source§

impl From<NodeAddr> for NodeTicket

source§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

+
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl From<NodeTicket> for NodeAddr

source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+
source§

impl From<PublicKey> for NodeAddr

source§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
source§

impl From<RemoteInfo> for NodeAddr

source§

fn from(info: RemoteInfo) -> Self

Converts to this type from the input type.
source§

impl Ord for NodeAddr

source§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for NodeAddr

§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

impl PartialEq for NodeAddr

source§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for NodeAddr

§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NodeAddr

source§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for NodeAddr

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for NodeAddr

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for NodeAddr

§

impl StructuralPartialEq for NodeAddr

Auto Trait Implementations§

§

impl Freeze for NodeAddr

§

impl RefUnwindSafe for NodeAddr

§

impl Send for NodeAddr

§

impl Sync for NodeAddr

§

impl Unpin for NodeAddr

§

impl UnwindSafe for NodeAddr

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for NodeAddr

source§

impl StructuralPartialEq for NodeAddr

Auto Trait Implementations§

§

impl Freeze for NodeAddr

§

impl RefUnwindSafe for NodeAddr

§

impl Send for NodeAddr

§

impl Sync for NodeAddr

§

impl Unpin for NodeAddr

§

impl UnwindSafe for NodeAddr

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/key/enum.KeyParsingError.html b/pr/2960/docs/iroh_net/key/enum.KeyParsingError.html index a6a5c061bc..ec42bbe54a 100644 --- a/pr/2960/docs/iroh_net/key/enum.KeyParsingError.html +++ b/pr/2960/docs/iroh_net/key/enum.KeyParsingError.html @@ -1,10 +1,10 @@ -KeyParsingError in iroh_net::key - Rust

Enum iroh_net::key::KeyParsingError

pub enum KeyParsingError {
-    Base32(HexOrBase32ParseError),
+KeyParsingError in iroh_net::key - Rust

Enum iroh_net::key::KeyParsingError

source ·
pub enum KeyParsingError {
+    Base32(HexOrBase32ParseError),
     Key(Error),
 }
Expand description

Error when deserialising a PublicKey or a SecretKey.

-

Variants§

§

Base32(HexOrBase32ParseError)

Error when decoding the base32.

+

Variants§

§

Base32(HexOrBase32ParseError)

Error when decoding the base32.

§

Key(Error)

Error when decoding the public key.

-

Trait Implementations§

§

impl Debug for KeyParsingError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for KeyParsingError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for KeyParsingError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<Error> for KeyParsingError

§

fn from(source: Error) -> KeyParsingError

Converts to this type from the input type.
§

impl From<HexOrBase32ParseError> for KeyParsingError

§

fn from(source: HexOrBase32ParseError) -> KeyParsingError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for KeyParsingError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for KeyParsingError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for KeyParsingError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for KeyParsingError

source§

fn from(source: Error) -> KeyParsingError

Converts to this type from the input type.
source§

impl From<HexOrBase32ParseError> for KeyParsingError

source§

fn from(source: HexOrBase32ParseError) -> KeyParsingError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/key/index.html b/pr/2960/docs/iroh_net/key/index.html index fe317e06b2..f6ce28ff2d 100644 --- a/pr/2960/docs/iroh_net/key/index.html +++ b/pr/2960/docs/iroh_net/key/index.html @@ -1,2 +1,2 @@ -iroh_net::key - Rust

Module iroh_net::key

Expand description

Cryptographic key handling for iroh-net.

+iroh_net::key - Rust

Module iroh_net::key

source ·
Expand description

Cryptographic key handling for iroh-net.

Structs§

Enums§

Constants§

Type Aliases§

  • The identifier for a node in the (iroh) network.
\ No newline at end of file diff --git a/pr/2960/docs/iroh_net/key/struct.PublicKey.html b/pr/2960/docs/iroh_net/key/struct.PublicKey.html index 7e8f54863b..7aaafc22a6 100644 --- a/pr/2960/docs/iroh_net/key/struct.PublicKey.html +++ b/pr/2960/docs/iroh_net/key/struct.PublicKey.html @@ -1,45 +1,45 @@ -PublicKey in iroh_net::key - Rust

Struct iroh_net::key::PublicKey

pub struct PublicKey(/* private fields */);
Expand description

A public key.

+PublicKey in iroh_net::key - Rust

Struct iroh_net::key::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A public key.

The key itself is just a 32 byte array, but a key has associated crypto information that is cached for performance reasons.

The cache item will be refreshed every time a crypto operation is performed, or when a key is deserialised or created from a byte array.

Serialisation or creation from a byte array is cheap if the key is already in the cache, but expensive if it is not.

-

Implementations§

§

impl PublicKey

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

-

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

+
source

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

§Warning

This will return a [SignatureError] if the bytes passed into this method do not represent a valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes. See [VerifyingKey::from_bytes] for details.

-

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

+
source

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

§Return

Returns Ok(()) if the signature is valid, and Err otherwise.

-

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string +

source

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string representation of the key.

-

Trait Implementations§

§

impl AsRef<[u8]> for PublicKey

§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for PublicKey

§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for PublicKey

§

fn deserialize<D>( +

Trait Implementations§

source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PublicKey

source§

fn deserialize<D>( deserializer: D ) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
where - D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<PublicKey> for NodeAddr

§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
§

impl From<VerifyingKey> for PublicKey

§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

+ D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<PublicKey> for NodeAddr

source§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
source§

impl From<VerifyingKey> for PublicKey

source§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
source§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

Display is capable of serialising this format.

-
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for PublicKey

§

fn hash<H>(&self, state: &mut H)
where +
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more

source§

impl Hash for PublicKey

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for PublicKey

§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for PublicKey

§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for PublicKey

§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for PublicKey

§

fn serialize<S>( +operator. Read more

source§

impl Serialize for PublicKey

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( bytes: &[u8] -) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( +) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
source§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( bytes: &[u8; 32] -) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
§

impl Copy for PublicKey

§

impl Eq for PublicKey

§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

§

impl Freeze for PublicKey

§

impl RefUnwindSafe for PublicKey

§

impl Send for PublicKey

§

impl Sync for PublicKey

§

impl Unpin for PublicKey

§

impl UnwindSafe for PublicKey

Blanket Implementations§

source§

impl<T> Any for T
where +) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
source§

impl Copy for PublicKey

source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

§

impl Freeze for PublicKey

§

impl RefUnwindSafe for PublicKey

§

impl Send for PublicKey

§

impl Sync for PublicKey

§

impl Unpin for PublicKey

§

impl UnwindSafe for PublicKey

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/key/struct.SecretKey.html b/pr/2960/docs/iroh_net/key/struct.SecretKey.html index 42742da74a..e35aa9673f 100644 --- a/pr/2960/docs/iroh_net/key/struct.SecretKey.html +++ b/pr/2960/docs/iroh_net/key/struct.SecretKey.html @@ -1,24 +1,24 @@ -SecretKey in iroh_net::key - Rust

Struct iroh_net::key::SecretKey

pub struct SecretKey { /* private fields */ }
Expand description

A secret key.

-

Implementations§

§

impl SecretKey

pub fn shared(&self, other: &PublicKey) -> SharedSecret

Returns the shared key for communication between this key and other.

-
§

impl SecretKey

pub fn public(&self) -> PublicKey

The public key of this SecretKey.

-

pub fn generate() -> SecretKey

Generate a new SecretKey with the default randomness generator.

-

pub fn generate_with_rng<R>(csprng: &mut R) -> SecretKey
where +SecretKey in iroh_net::key - Rust

Struct iroh_net::key::SecretKey

source ·
pub struct SecretKey { /* private fields */ }
Expand description

A secret key.

+

Implementations§

source§

impl SecretKey

source

pub fn shared(&self, other: &PublicKey) -> SharedSecret

Returns the shared key for communication between this key and other.

+
source§

impl SecretKey

source

pub fn public(&self) -> PublicKey

The public key of this SecretKey.

+
source

pub fn generate() -> SecretKey

Generate a new SecretKey with the default randomness generator.

+
source

pub fn generate_with_rng<R>(csprng: &mut R) -> SecretKey
where R: CryptoRngCore + ?Sized,

Generate a new SecretKey with a randomness generator.

-

pub fn to_openssh(&self) -> Result<Zeroizing<String>, Error>

Serialise this key to OpenSSH format.

-

pub fn try_from_openssh<T>(data: T) -> Result<SecretKey, Error>
where +

source

pub fn to_openssh(&self) -> Result<Zeroizing<String>, Error>

Serialise this key to OpenSSH format.

+
source

pub fn try_from_openssh<T>(data: T) -> Result<SecretKey, Error>
where T: AsRef<[u8]>,

Deserialise this key from OpenSSH format.

-

pub fn sign(&self, msg: &[u8]) -> Signature

Sign the given message and return a digital signature

-

pub fn to_bytes(&self) -> [u8; 32]

Convert this to the bytes representing the secret part. +

source

pub fn sign(&self, msg: &[u8]) -> Signature

Sign the given message and return a digital signature

+
source

pub fn to_bytes(&self) -> [u8; 32]

Convert this to the bytes representing the secret part. The public part can always be recovered.

-

pub fn from_bytes(bytes: &[u8; 32]) -> SecretKey

Create a secret key from its byte representation.

-

Trait Implementations§

§

impl Clone for SecretKey

§

fn clone(&self) -> SecretKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SecretKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for SecretKey

§

fn deserialize<D>( +

source

pub fn from_bytes(bytes: &[u8; 32]) -> SecretKey

Create a secret key from its byte representation.

+

Trait Implementations§

source§

impl Clone for SecretKey

source§

fn clone(&self) -> SecretKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SecretKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SecretKey

source§

fn deserialize<D>( deserializer: D ) -> Result<SecretKey, <D as Deserializer<'de>>::Error>
where - D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for SecretKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<[u8; 32]> for SecretKey

§

fn from(value: [u8; 32]) -> SecretKey

Converts to this type from the input type.
§

impl From<SigningKey> for SecretKey

§

fn from(secret: SigningKey) -> SecretKey

Converts to this type from the input type.
§

impl FromStr for SecretKey

§

type Err = KeyParsingError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<SecretKey, <SecretKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Serialize for SecretKey

§

fn serialize<S>( + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for SecretKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<[u8; 32]> for SecretKey

source§

fn from(value: [u8; 32]) -> SecretKey

Converts to this type from the input type.
source§

impl From<SigningKey> for SecretKey

source§

fn from(secret: SigningKey) -> SecretKey

Converts to this type from the input type.
source§

impl FromStr for SecretKey

§

type Err = KeyParsingError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<SecretKey, <SecretKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Serialize for SecretKey

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TryFrom<&[u8]> for SecretKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&[u8]> for SecretKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from( bytes: &[u8] ) -> Result<SecretKey, <SecretKey as TryFrom<&[u8]>>::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl !Freeze for SecretKey

§

impl RefUnwindSafe for SecretKey

§

impl Send for SecretKey

§

impl Sync for SecretKey

§

impl Unpin for SecretKey

§

impl UnwindSafe for SecretKey

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/pr/2960/docs/iroh_net/key/struct.SharedSecret.html b/pr/2960/docs/iroh_net/key/struct.SharedSecret.html index c5fadbfb4f..6c79c6c567 100644 --- a/pr/2960/docs/iroh_net/key/struct.SharedSecret.html +++ b/pr/2960/docs/iroh_net/key/struct.SharedSecret.html @@ -1,7 +1,7 @@ -SharedSecret in iroh_net::key - Rust

Struct iroh_net::key::SharedSecret

pub struct SharedSecret(/* private fields */);
Expand description

Shared Secret.

-

Implementations§

§

impl SharedSecret

pub fn seal(&self, buffer: &mut dyn Buffer)

Seals the provided cleartext.

-

pub fn open(&self, buffer: &mut dyn Buffer) -> Result<(), Error>

Opens the ciphertext, which must have been created using Self::seal, and places the clear text into the provided buffer.

-

Trait Implementations§

§

impl Debug for SharedSecret

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +SharedSecret in iroh_net::key - Rust

Struct iroh_net::key::SharedSecret

source ·
pub struct SharedSecret(/* private fields */);
Expand description

Shared Secret.

+

Implementations§

source§

impl SharedSecret

source

pub fn seal(&self, buffer: &mut dyn Buffer)

Seals the provided cleartext.

+
source

pub fn open(&self, buffer: &mut dyn Buffer) -> Result<(), Error>

Opens the ciphertext, which must have been created using Self::seal, and places the clear text into the provided buffer.

+

Trait Implementations§

source§

impl Debug for SharedSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/key/type.NodeId.html b/pr/2960/docs/iroh_net/key/type.NodeId.html index e45ed49bae..744b824071 100644 --- a/pr/2960/docs/iroh_net/key/type.NodeId.html +++ b/pr/2960/docs/iroh_net/key/type.NodeId.html @@ -1,4 +1,4 @@ -NodeId in iroh_net::key - Rust

Type Alias iroh_net::key::NodeId

pub type NodeId = PublicKey;
Expand description

The identifier for a node in the (iroh) network.

+NodeId in iroh_net::key - Rust

Type Alias iroh_net::key::NodeId

source ·
pub type NodeId = PublicKey;
Expand description

The identifier for a node in the (iroh) network.

Each node in iroh has a unique identifier created as a cryptographic key. This can be used to globally identify a node. Since it is also a cryptographic key it is also the mechanism by which all traffic is always encrypted for a specific node only.

diff --git a/pr/2960/docs/iroh_net/struct.AddrInfo.html b/pr/2960/docs/iroh_net/struct.AddrInfo.html index 7647d1c08b..4ea3dce1e0 100644 --- a/pr/2960/docs/iroh_net/struct.AddrInfo.html +++ b/pr/2960/docs/iroh_net/struct.AddrInfo.html @@ -1,4 +1,4 @@ -AddrInfo in iroh_net - Rust

Struct iroh_net::AddrInfo

pub struct AddrInfo {
+AddrInfo in iroh_net - Rust

Struct iroh_net::AddrInfo

source ·
pub struct AddrInfo {
     pub relay_url: Option<RelayUrl>,
     pub direct_addresses: BTreeSet<SocketAddr>,
 }
Expand description

Network paths to contact an iroh-net node.

@@ -7,26 +7,26 @@ Unless a [discovery service] is used at least one path is required to connect to other node, see NodeAddr for details.

Fields§

§relay_url: Option<RelayUrl>

The node’s home relay url.

§direct_addresses: BTreeSet<SocketAddr>

Socket addresses where the peer might be reached directly.

-

Implementations§

§

impl AddrInfo

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+

Implementations§

source§

impl AddrInfo

source

pub fn is_empty(&self) -> bool

Returns whether this addressing information is empty.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in ab AddrInfo received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

Trait Implementations§

§

impl Clone for AddrInfo

§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for AddrInfo

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AddrInfo

§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for AddrInfo

§

fn deserialize<__D>( +

Trait Implementations§

source§

impl Clone for AddrInfo

source§

fn clone(&self) -> AddrInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddrInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for AddrInfo

source§

fn default() -> AddrInfo

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for AddrInfo

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<AddrInfo, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl Ord for AddrInfo

§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<NodeInfo> for AddrInfo

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl Ord for AddrInfo

source§

fn cmp(&self, other: &AddrInfo) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for AddrInfo

§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more

source§

impl PartialEq for AddrInfo

source§

fn eq(&self, other: &AddrInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for AddrInfo

§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AddrInfo

source§

fn partial_cmp(&self, other: &AddrInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for AddrInfo

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for AddrInfo

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for AddrInfo

§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

§

impl Freeze for AddrInfo

§

impl RefUnwindSafe for AddrInfo

§

impl Send for AddrInfo

§

impl Sync for AddrInfo

§

impl Unpin for AddrInfo

§

impl UnwindSafe for AddrInfo

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for AddrInfo

source§

impl StructuralPartialEq for AddrInfo

Auto Trait Implementations§

§

impl Freeze for AddrInfo

§

impl RefUnwindSafe for AddrInfo

§

impl Send for AddrInfo

§

impl Sync for AddrInfo

§

impl Unpin for AddrInfo

§

impl UnwindSafe for AddrInfo

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/struct.NodeAddr.html b/pr/2960/docs/iroh_net/struct.NodeAddr.html index a846006a65..54f6a54f4d 100644 --- a/pr/2960/docs/iroh_net/struct.NodeAddr.html +++ b/pr/2960/docs/iroh_net/struct.NodeAddr.html @@ -1,4 +1,4 @@ -NodeAddr in iroh_net - Rust

Struct iroh_net::NodeAddr

pub struct NodeAddr {
+NodeAddr in iroh_net - Rust

Struct iroh_net::NodeAddr

source ·
pub struct NodeAddr {
     pub node_id: PublicKey,
     pub info: AddrInfo,
 }
Expand description

Network-level addressing information for an iroh-net node.

@@ -25,40 +25,40 @@ number of network-level addressing information. It is a generic addressing type whenever a connection to other nodes needs to be established.

Fields§

§node_id: PublicKey

The node’s identifier.

§info: AddrInfo

Addressing information to connect to Self::node_id.

-

Implementations§

§

impl NodeAddr

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

-

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

-

pub fn with_direct_addresses( +

Implementations§

source§

impl NodeAddr

source

pub fn new(node_id: PublicKey) -> NodeAddr

Creates a new NodeAddr with empty AddrInfo.

+
source

pub fn with_relay_url(self, relay_url: RelayUrl) -> NodeAddr

Adds a relay url to the node’s AddrInfo.

+
source

pub fn with_direct_addresses( self, addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Adds the given direct addresses to the peer’s AddrInfo.

-

pub fn from_parts( +

source

pub fn from_parts( node_id: PublicKey, relay_url: Option<RelayUrl>, direct_addresses: impl IntoIterator<Item = SocketAddr> ) -> NodeAddr

Creates a new NodeAddr from its parts.

-

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

+
source

pub fn apply_options(&mut self, opts: AddrInfoOptions)

Applies the options to self.

This is used to more tightly control the information stored in a NodeAddr received from another API. E.g. to ensure a discovery service is used the AddrInfoOptions::Id] option could be used to remove all other addressing details.

-

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

-

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

-

Trait Implementations§

§

impl Clone for NodeAddr

§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NodeAddr

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeAddr

§

fn deserialize<__D>( +

source

pub fn direct_addresses(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of this peer.

+
source

pub fn relay_url(&self) -> Option<&RelayUrl>

Returns the relay url of this peer.

+

Trait Implementations§

source§

impl Clone for NodeAddr

source§

fn clone(&self) -> NodeAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeAddr

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<NodeAddr, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
§

impl From<NodeAddr> for NodeTicket

§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

-
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
§

impl From<NodeTicket> for NodeAddr

§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

-
§

impl From<PublicKey> for NodeAddr

§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
source§

impl From<RemoteInfo> for NodeAddr

source§

fn from(info: RemoteInfo) -> Self

Converts to this type from the input type.
§

impl Ord for NodeAddr

§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr

source§

fn from(value: (PublicKey, Option<RelayUrl>, &[SocketAddr])) -> NodeAddr

Converts to this type from the input type.
source§

impl From<NodeAddr> for NodeTicket

source§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

+
source§

impl From<NodeInfo> for NodeAddr

source§

fn from(value: NodeInfo) -> Self

Converts to this type from the input type.
source§

impl From<NodeTicket> for NodeAddr

source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+
source§

impl From<PublicKey> for NodeAddr

source§

fn from(node_id: PublicKey) -> NodeAddr

Converts to this type from the input type.
source§

impl From<RemoteInfo> for NodeAddr

source§

fn from(info: RemoteInfo) -> Self

Converts to this type from the input type.
source§

impl Ord for NodeAddr

source§

fn cmp(&self, other: &NodeAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for NodeAddr

§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

impl PartialEq for NodeAddr

source§

fn eq(&self, other: &NodeAddr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for NodeAddr

§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NodeAddr

source§

fn partial_cmp(&self, other: &NodeAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for NodeAddr

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for NodeAddr

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for NodeAddr

§

impl StructuralPartialEq for NodeAddr

Auto Trait Implementations§

§

impl Freeze for NodeAddr

§

impl RefUnwindSafe for NodeAddr

§

impl Send for NodeAddr

§

impl Sync for NodeAddr

§

impl Unpin for NodeAddr

§

impl UnwindSafe for NodeAddr

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for NodeAddr

source§

impl StructuralPartialEq for NodeAddr

Auto Trait Implementations§

§

impl Freeze for NodeAddr

§

impl RefUnwindSafe for NodeAddr

§

impl Send for NodeAddr

§

impl Sync for NodeAddr

§

impl Unpin for NodeAddr

§

impl UnwindSafe for NodeAddr

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/struct.RelayMap.html b/pr/2960/docs/iroh_net/struct.RelayMap.html index 574fbed079..a0bafe2fa3 100644 --- a/pr/2960/docs/iroh_net/struct.RelayMap.html +++ b/pr/2960/docs/iroh_net/struct.RelayMap.html @@ -1,24 +1,24 @@ -RelayMap in iroh_net - Rust

Struct iroh_net::RelayMap

pub struct RelayMap { /* private fields */ }
Expand description

Configuration of all the relay servers that can be used.

-

Implementations§

§

impl RelayMap

pub fn urls(&self) -> impl Iterator<Item = &RelayUrl>

Returns the sorted relay URLs.

-

pub fn empty() -> RelayMap

Create an empty relay map.

-

pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>

Returns an Iterator over all known nodes.

-

pub fn contains_node(&self, url: &RelayUrl) -> bool

Is this a known node?

-

pub fn get_node(&self, url: &RelayUrl) -> Option<&Arc<RelayNode>>

Get the given node.

-

pub fn len(&self) -> usize

How many nodes are known?

-

pub fn is_empty(&self) -> bool

Are there any nodes in this map?

-

pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap

Creates a new RelayMap with a single relay server configured.

+RelayMap in iroh_net - Rust

Struct iroh_net::RelayMap

source ·
pub struct RelayMap { /* private fields */ }
Expand description

Configuration of all the relay servers that can be used.

+

Implementations§

source§

impl RelayMap

source

pub fn urls(&self) -> impl Iterator<Item = &RelayUrl>

Returns the sorted relay URLs.

+
source

pub fn empty() -> RelayMap

Create an empty relay map.

+
source

pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>

Returns an Iterator over all known nodes.

+
source

pub fn contains_node(&self, url: &RelayUrl) -> bool

Is this a known node?

+
source

pub fn get_node(&self, url: &RelayUrl) -> Option<&Arc<RelayNode>>

Get the given node.

+
source

pub fn len(&self) -> usize

How many nodes are known?

+
source

pub fn is_empty(&self) -> bool

Are there any nodes in this map?

+
source

pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap

Creates a new RelayMap with a single relay server configured.

Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6. If IP addresses are provided, no DNS lookup will be performed.

-

pub fn from_url(url: RelayUrl) -> RelayMap

Returns a RelayMap from a RelayUrl.

+
source

pub fn from_url(url: RelayUrl) -> RelayMap

Returns a RelayMap from a RelayUrl.

This will use the default STUN port and IP addresses resolved from the URL’s host name via DNS. relay nodes are specified at <../../docs/relay_nodes.md>

-

pub fn from_nodes<I>( +

source

pub fn from_nodes<I>( value: impl IntoIterator<Item = I> ) -> Result<RelayMap, Error>
where I: Into<Arc<RelayNode>>,

Constructs the RelayMap from an iterator of RelayNodes.

-

Trait Implementations§

§

impl Clone for RelayMap

§

fn clone(&self) -> RelayMap

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for RelayMap

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for RelayMap

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for RelayMap

§

fn eq(&self, other: &RelayMap) -> bool

This method tests for self and other values to be equal, and is used +

Trait Implementations§

source§

impl Clone for RelayMap

source§

fn clone(&self) -> RelayMap

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RelayMap

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for RelayMap

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq for RelayMap

source§

fn eq(&self, other: &RelayMap) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Eq for RelayMap

§

impl StructuralPartialEq for RelayMap

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +sufficient, and should not be overridden without very good reason.

source§

impl Eq for RelayMap

source§

impl StructuralPartialEq for RelayMap

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/struct.RelayNode.html b/pr/2960/docs/iroh_net/struct.RelayNode.html index 99bdb4ef4a..2ec053da3e 100644 --- a/pr/2960/docs/iroh_net/struct.RelayNode.html +++ b/pr/2960/docs/iroh_net/struct.RelayNode.html @@ -1,4 +1,4 @@ -RelayNode in iroh_net - Rust

Struct iroh_net::RelayNode

pub struct RelayNode {
+RelayNode in iroh_net - Rust

Struct iroh_net::RelayNode

source ·
pub struct RelayNode {
     pub url: RelayUrl,
     pub stun_only: bool,
     pub stun_port: u16,
@@ -10,21 +10,21 @@
 functionality is used.

§stun_port: u16

The stun port of the relay server.

Setting this to 0 means the default STUN port is used.

-

Trait Implementations§

§

impl Clone for RelayNode

§

fn clone(&self) -> RelayNode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for RelayNode

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for RelayNode

§

fn deserialize<__D>( +

Trait Implementations§

source§

impl Clone for RelayNode

source§

fn clone(&self) -> RelayNode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RelayNode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for RelayNode

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for RelayNode

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for RelayNode

§

fn cmp(&self, other: &RelayNode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for RelayNode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Ord for RelayNode

source§

fn cmp(&self, other: &RelayNode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for RelayNode

§

fn eq(&self, other: &RelayNode) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more

source§

impl PartialEq for RelayNode

source§

fn eq(&self, other: &RelayNode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for RelayNode

§

fn partial_cmp(&self, other: &RelayNode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for RelayNode

source§

fn partial_cmp(&self, other: &RelayNode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for RelayNode

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for RelayNode

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for RelayNode

§

impl StructuralPartialEq for RelayNode

Auto Trait Implementations§

§

impl Freeze for RelayNode

§

impl RefUnwindSafe for RelayNode

§

impl Send for RelayNode

§

impl Sync for RelayNode

§

impl Unpin for RelayNode

§

impl UnwindSafe for RelayNode

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for RelayNode

source§

impl StructuralPartialEq for RelayNode

Auto Trait Implementations§

§

impl Freeze for RelayNode

§

impl RefUnwindSafe for RelayNode

§

impl Send for RelayNode

§

impl Sync for RelayNode

§

impl Unpin for RelayNode

§

impl UnwindSafe for RelayNode

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/struct.RelayUrl.html b/pr/2960/docs/iroh_net/struct.RelayUrl.html index c023830d91..4c89e6d6dd 100644 --- a/pr/2960/docs/iroh_net/struct.RelayUrl.html +++ b/pr/2960/docs/iroh_net/struct.RelayUrl.html @@ -1,4 +1,4 @@ -RelayUrl in iroh_net - Rust

Struct iroh_net::RelayUrl

pub struct RelayUrl(/* private fields */);
Expand description

A URL identifying a relay server.

+RelayUrl in iroh_net - Rust

Struct iroh_net::RelayUrl

source ·
pub struct RelayUrl(/* private fields */);
Expand description

A URL identifying a relay server.

This is but a wrapper around Url, with a few custom tweaks:

  • @@ -443,30 +443,30 @@ or if Path::new_opt() returns None. (That is, if the percent-decoded path contains a NUL byte or, for a Windows path, is not UTF-8.)

    This method is only available if the std Cargo feature is enabled.

    -

Trait Implementations§

§

impl Clone for RelayUrl

§

fn clone(&self) -> RelayUrl

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for RelayUrl

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for RelayUrl

Dereferences to the wrapped Url.

+

Trait Implementations§

source§

impl Clone for RelayUrl

source§

fn clone(&self) -> RelayUrl

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RelayUrl

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for RelayUrl

Dereferences to the wrapped Url.

Note that DerefMut is not implemented on purpose, so this type has more flexibility to change the inner later.

-
§

type Target = Url

The resulting type after dereferencing.
§

fn deref(&self) -> &<RelayUrl as Deref>::Target

Dereferences the value.
§

impl<'de> Deserialize<'de> for RelayUrl

§

fn deserialize<__D>( +

§

type Target = Url

The resulting type after dereferencing.
source§

fn deref(&self) -> &<RelayUrl as Deref>::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for RelayUrl

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<RelayUrl, <__D as Deserializer<'de>>::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for RelayUrl

§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<RelayUrl> for Url

§

fn from(value: RelayUrl) -> Url

Converts to this type from the input type.
§

impl From<Url> for RelayUrl

§

fn from(url: Url) -> RelayUrl

Converts to this type from the input type.
§

impl FromStr for RelayUrl

Support for parsing strings directly.

+ __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for RelayUrl

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<RelayUrl> for Url

source§

fn from(value: RelayUrl) -> Url

Converts to this type from the input type.
source§

impl From<Url> for RelayUrl

source§

fn from(url: Url) -> RelayUrl

Converts to this type from the input type.
source§

impl FromStr for RelayUrl

Support for parsing strings directly.

If you need more control over the error first create a Url and use RelayUrl::from instead.

-
§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<RelayUrl, <RelayUrl as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for RelayUrl

§

fn hash<__H>(&self, state: &mut __H)
where +
§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<RelayUrl, <RelayUrl as FromStr>::Err>

Parses a string s to return a value of this type. Read more

source§

impl Hash for RelayUrl

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for RelayUrl

§

fn cmp(&self, other: &RelayUrl) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for RelayUrl

source§

fn cmp(&self, other: &RelayUrl) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for RelayUrl

§

fn eq(&self, other: &RelayUrl) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,
Restrict a value to a certain interval. Read more
source§

impl PartialEq for RelayUrl

source§

fn eq(&self, other: &RelayUrl) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for RelayUrl

§

fn partial_cmp(&self, other: &RelayUrl) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for RelayUrl

source§

fn partial_cmp(&self, other: &RelayUrl) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Serialize for RelayUrl

§

fn serialize<__S>( +operator. Read more

source§

impl Serialize for RelayUrl

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for RelayUrl

§

impl StructuralPartialEq for RelayUrl

Auto Trait Implementations§

§

impl Freeze for RelayUrl

§

impl RefUnwindSafe for RelayUrl

§

impl Send for RelayUrl

§

impl Sync for RelayUrl

§

impl Unpin for RelayUrl

§

impl UnwindSafe for RelayUrl

Blanket Implementations§

source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for RelayUrl

source§

impl StructuralPartialEq for RelayUrl

Auto Trait Implementations§

§

impl Freeze for RelayUrl

§

impl RefUnwindSafe for RelayUrl

§

impl Send for RelayUrl

§

impl Sync for RelayUrl

§

impl Unpin for RelayUrl

§

impl UnwindSafe for RelayUrl

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/ticket/struct.NodeTicket.html b/pr/2960/docs/iroh_net/ticket/struct.NodeTicket.html index 63f9a8449f..8fd5ff47ca 100644 --- a/pr/2960/docs/iroh_net/ticket/struct.NodeTicket.html +++ b/pr/2960/docs/iroh_net/ticket/struct.NodeTicket.html @@ -1,4 +1,4 @@ -NodeTicket in iroh_net::ticket - Rust

Struct iroh_net::ticket::NodeTicket

pub struct NodeTicket { /* private fields */ }
Expand description

A token containing information for establishing a connection to a node.

+NodeTicket in iroh_net::ticket - Rust

Struct iroh_net::ticket::NodeTicket

source ·
pub struct NodeTicket { /* private fields */ }
Expand description

A token containing information for establishing a connection to a node.

Contains

  • The NodeId of the node to connect to (a 32-byte ed25519 public key).
  • @@ -10,20 +10,20 @@ possible to do so.

    This NodeTicket is a single item which can be easily serialized and deserialized and implements the Ticket trait. The Display and FromStr traits can also be used to round-trip the ticket to string.

    -

Implementations§

§

impl NodeTicket

pub fn new(node: NodeAddr) -> NodeTicket

Creates a new ticket.

-

pub fn node_addr(&self) -> &NodeAddr

The NodeAddr of the provider for this ticket.

-

Trait Implementations§

§

impl Clone for NodeTicket

§

fn clone(&self) -> NodeTicket

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for NodeTicket

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for NodeTicket

§

fn deserialize<D>( +

Implementations§

source§

impl NodeTicket

source

pub fn new(node: NodeAddr) -> NodeTicket

Creates a new ticket.

+
source

pub fn node_addr(&self) -> &NodeAddr

The NodeAddr of the provider for this ticket.

+

Trait Implementations§

source§

impl Clone for NodeTicket

source§

fn clone(&self) -> NodeTicket

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeTicket

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for NodeTicket

source§

fn deserialize<D>( deserializer: D ) -> Result<NodeTicket, <D as Deserializer<'de>>::Error>
where - D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for NodeTicket

§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<NodeAddr> for NodeTicket

§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

-
§

impl From<NodeTicket> for NodeAddr

§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

-
§

impl FromStr for NodeTicket

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<NodeTicket, <NodeTicket as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl PartialEq for NodeTicket

§

fn eq(&self, other: &NodeTicket) -> bool

This method tests for self and other values to be equal, and is used + D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for NodeTicket

source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<NodeAddr> for NodeTicket

source§

fn from(addr: NodeAddr) -> NodeTicket

Creates a ticket from given addressing info.

+
source§

impl From<NodeTicket> for NodeAddr

source§

fn from(ticket: NodeTicket) -> NodeAddr

Returns the addressing info from given ticket.

+
source§

impl FromStr for NodeTicket

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<NodeTicket, <NodeTicket as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for NodeTicket

source§

fn eq(&self, other: &NodeTicket) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Serialize for NodeTicket

§

fn serialize<S>( +sufficient, and should not be overridden without very good reason.

source§

impl Serialize for NodeTicket

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where - S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Ticket for NodeTicket

§

const KIND: &'static str = "node"

String prefix describing the kind of iroh ticket. Read more
§

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.
§

fn from_bytes(bytes: &[u8]) -> Result<NodeTicket, Error>

Deserialize from the base32 string representation bytes.
§

fn serialize(&self) -> String

Serialize to string.
§

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.
§

impl Eq for NodeTicket

§

impl StructuralPartialEq for NodeTicket

Auto Trait Implementations§

§

impl Freeze for NodeTicket

§

impl RefUnwindSafe for NodeTicket

§

impl Send for NodeTicket

§

impl Sync for NodeTicket

§

impl Unpin for NodeTicket

§

impl UnwindSafe for NodeTicket

Blanket Implementations§

source§

impl<T> Any for T
where + S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Ticket for NodeTicket

source§

const KIND: &'static str = "node"

String prefix describing the kind of iroh ticket. Read more
source§

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.
source§

fn from_bytes(bytes: &[u8]) -> Result<NodeTicket, Error>

Deserialize from the base32 string representation bytes.
source§

fn serialize(&self) -> String

Serialize to string.
source§

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.
source§

impl Eq for NodeTicket

source§

impl StructuralPartialEq for NodeTicket

Auto Trait Implementations§

§

impl Freeze for NodeTicket

§

impl RefUnwindSafe for NodeTicket

§

impl Send for NodeTicket

§

impl Sync for NodeTicket

§

impl Unpin for NodeTicket

§

impl UnwindSafe for NodeTicket

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/2960/docs/iroh_net/ticket/trait.Ticket.html b/pr/2960/docs/iroh_net/ticket/trait.Ticket.html index 62d1eea749..aeb5ad78e9 100644 --- a/pr/2960/docs/iroh_net/ticket/trait.Ticket.html +++ b/pr/2960/docs/iroh_net/ticket/trait.Ticket.html @@ -1,13 +1,13 @@ -Ticket in iroh_net::ticket - Rust

Trait iroh_net::ticket::Ticket

pub trait Ticket: Sized {
+Ticket in iroh_net::ticket - Rust

Trait iroh_net::ticket::Ticket

source ·
pub trait Ticket: Sized {
     const KIND: &'static str;
 
     // Required methods
     fn to_bytes(&self) -> Vec<u8> ⓘ;
-    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
 
     // Provided methods
     fn serialize(&self) -> String { ... }
-    fn deserialize(str: &str) -> Result<Self, Error> { ... }
+    fn deserialize(str: &str) -> Result<Self, Error> { ... }
 }
Expand description

A ticket is a serializable object combining information required for an operation.

Typically tickets contain all information required for an operation, e.g. an iroh blob ticket would contain the hash of the data as well as information about how to reach the @@ -18,10 +18,10 @@ ticket will be prepended to the string to make it somewhat self describing.

versioning, others might not.

The serialization format for converting the ticket from and to bytes is left to the implementer. We recommend using postcard for serialization.

-

Required Associated Constants§

const KIND: &'static str

String prefix describing the kind of iroh ticket.

+

Required Associated Constants§

source

const KIND: &'static str

String prefix describing the kind of iroh ticket.

This should be lower case ascii characters.

-

Required Methods§

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.

-

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from the base32 string representation bytes.

-

Provided Methods§

fn serialize(&self) -> String

Serialize to string.

-

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.

-

Object Safety§

This trait is not object safe.

Implementors§

§

impl Ticket for NodeTicket

§

const KIND: &'static str = "node"

§

impl Ticket for BlobTicket

§

const KIND: &'static str = "blob"

\ No newline at end of file +

Required Methods§

source

fn to_bytes(&self) -> Vec<u8> ⓘ

Serialize to bytes used in the base32 string representation.

+
source

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from the base32 string representation bytes.

+

Provided Methods§

source

fn serialize(&self) -> String

Serialize to string.

+
source

fn deserialize(str: &str) -> Result<Self, Error>

Deserialize from a string.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Ticket for BlobTicket

source§

const KIND: &'static str = "blob"

source§

impl Ticket for NodeTicket

source§

const KIND: &'static str = "node"

\ No newline at end of file diff --git a/pr/2960/docs/iroh_net/type.NodeId.html b/pr/2960/docs/iroh_net/type.NodeId.html index 22237ce40e..c99be03560 100644 --- a/pr/2960/docs/iroh_net/type.NodeId.html +++ b/pr/2960/docs/iroh_net/type.NodeId.html @@ -1,4 +1,4 @@ -NodeId in iroh_net - Rust

Type Alias iroh_net::NodeId

pub type NodeId = PublicKey;
Expand description

The identifier for a node in the (iroh) network.

+NodeId in iroh_net - Rust

Type Alias iroh_net::NodeId

source ·
pub type NodeId = PublicKey;
Expand description

The identifier for a node in the (iroh) network.

Each node in iroh has a unique identifier created as a cryptographic key. This can be used to globally identify a node. Since it is also a cryptographic key it is also the mechanism by which all traffic is always encrypted for a specific node only.

diff --git a/pr/2960/docs/type.impl/iroh_net/key/struct.PublicKey.js b/pr/2960/docs/type.impl/iroh_net/key/struct.PublicKey.js index fe33e54257..e5e292b351 100644 --- a/pr/2960/docs/type.impl/iroh_net/key/struct.PublicKey.js +++ b/pr/2960/docs/type.impl/iroh_net/key/struct.PublicKey.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"iroh_net":[["
§

impl AsRef<[u8]> for PublicKey

§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[u8]>","iroh_net::NodeId"],["
§

impl Clone for PublicKey

§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","iroh_net::NodeId"],["
§

impl Debug for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","iroh_net::NodeId"],["
§

impl<'de> Deserialize<'de> for PublicKey

§

fn deserialize<D>(\n deserializer: D\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","iroh_net::NodeId"],["
§

impl Display for PublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","iroh_net::NodeId"],["
§

impl From<VerifyingKey> for PublicKey

§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
","From","iroh_net::NodeId"],["
§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

\n

Display is capable of serialising this format.

\n
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
","FromStr","iroh_net::NodeId"],["
§

impl Hash for PublicKey

§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","iroh_net::NodeId"],["
§

impl Ord for PublicKey

§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","iroh_net::NodeId"],["
§

impl PartialEq for PublicKey

§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","iroh_net::NodeId"],["
§

impl PartialOrd for PublicKey

§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","iroh_net::NodeId"],["
§

impl PublicKey

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

\n

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

\n
§Warning
\n

This will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.

\n

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

\n
§Return
\n

Returns Ok(()) if the signature is valid, and Err otherwise.

\n

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string\nrepresentation of the key.

\n
",0,"iroh_net::NodeId"],["
§

impl Serialize for PublicKey

§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","iroh_net::NodeId"],["
§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(\n bytes: &[u8]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
","TryFrom<&[u8]>","iroh_net::NodeId"],["
§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(\n bytes: &[u8; 32]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
","TryFrom<&[u8; 32]>","iroh_net::NodeId"],["
§

impl Copy for PublicKey

","Copy","iroh_net::NodeId"],["
§

impl Eq for PublicKey

","Eq","iroh_net::NodeId"],["
§

impl StructuralPartialEq for PublicKey

","StructuralPartialEq","iroh_net::NodeId"]] +"iroh_net":[["
source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[u8]>","iroh_net::NodeId"],["
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","iroh_net::NodeId"],["
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","iroh_net::NodeId"],["
source§

impl<'de> Deserialize<'de> for PublicKey

source§

fn deserialize<D>(\n deserializer: D\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","iroh_net::NodeId"],["
source§

impl Display for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","iroh_net::NodeId"],["
source§

impl From<VerifyingKey> for PublicKey

source§

fn from(verifying_key: VerifyingKey) -> PublicKey

Converts to this type from the input type.
","From","iroh_net::NodeId"],["
source§

impl FromStr for PublicKey

Deserialises the PublicKey from it’s base32 encoding.

\n

Display is capable of serialising this format.

\n
§

type Err = KeyParsingError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

Parses a string s to return a value of this type. Read more
","FromStr","iroh_net::NodeId"],["
source§

impl Hash for PublicKey

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","iroh_net::NodeId"],["
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","iroh_net::NodeId"],["
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","iroh_net::NodeId"],["
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","iroh_net::NodeId"],["
source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8; 32]

Get this public key as a byte array.

\n
source

pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, Error>

Construct a PublicKey from a slice of bytes.

\n
§Warning
\n

This will return a [SignatureError] if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.

\n
source

pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>

Verify a signature on a message with this secret key’s public key.

\n
§Return
\n

Returns Ok(()) if the signature is valid, and Err otherwise.

\n
source

pub fn fmt_short(&self) -> String

Convert to a base32 string limited to the first 10 bytes for a friendly string\nrepresentation of the key.

\n
",0,"iroh_net::NodeId"],["
source§

impl Serialize for PublicKey

source§

fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","iroh_net::NodeId"],["
source§

impl TryFrom<&[u8]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(\n bytes: &[u8]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
","TryFrom<&[u8]>","iroh_net::NodeId"],["
source§

impl TryFrom<&[u8; 32]> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(\n bytes: &[u8; 32]\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

Performs the conversion.
","TryFrom<&[u8; 32]>","iroh_net::NodeId"],["
source§

impl Copy for PublicKey

","Copy","iroh_net::NodeId"],["
source§

impl Eq for PublicKey

","Eq","iroh_net::NodeId"],["
source§

impl StructuralPartialEq for PublicKey

","StructuralPartialEq","iroh_net::NodeId"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file