Module endpoint

Module endpoint 

Source
Expand description

The Endpoint allows establishing connections to other iroh endpoints.

The Endpoint is the main API interface to manage a local iroh endpoint. It allows connecting to and accepting connections from other endpoints. See the module docs for more details on how iroh connections work.

The main items in this module are:

Re-exports§

pub use crate::tls::TlsConfigError;

Modules§

presets
Presets allow configuring an endpoint quickly with a chosen set of defaults.
transportsunstable-custom-transports
Types for defining custom transports and path selectors.

Structs§

Accept
Future produced by Endpoint::accept.
AcceptBi
noq types that are used in the public iroh API. Future produced by [Connection::accept_bi]
AcceptUni
noq types that are used in the public iroh API. Future produced by [Connection::accept_uni]
Accepting
In-progress connection attempt future
AckFrequencyConfig
noq types that are used in the public iroh API. Parameters for controlling the peer’s acknowledgement frequency
ApplicationClose
Reason given by an application for closing the connection
BindOptsNon-wasm_browser
Options when configuring binding an IP socket.
Builder
Builder for Endpoint.
Chunk
A chunk of data from the receive stream
Closed
noq types that are used in the public iroh API. State of a [Connection] at the moment it was closed.
ClosedStream
noq types that are used in the public iroh API. Error indicating that a stream has not been opened or has already been finished or reset
ConnectOptions
Options for the Endpoint::connect_with_opts function.
Connecting
An outgoing connection in progress.
Connection
A QUIC connection.
ConnectionClose
Reason given by the transport for closing the connection
ConnectionStats
noq types that are used in the public iroh API. Connection statistics.
ControllerMetrics
Common congestion controller metrics used both for logging purposes but also to alter the pacing of the connection with pacing_rate and send_quantum
CryptoError
Generic crypto errors
DecryptedInitial
Decrypted payload of a QUIC Initial packet
DirectAddr
A direct address on which an iroh-endpoint might be contactable.
Endpoint
Controls an iroh endpoint, establishing connections with other endpoints.
EndpointClosed
Future returned from Endpoint::closed.
ExportKeyingMaterialError
Error returned by [Session::export_keying_material].
FrameStats
Number of frames transmitted or received of each frame type.
HandshakeCompleted
Marker type for a connection that has completed the handshake.
IdleTimeout
noq types that are used in the public iroh API. Maximum duration of inactivity to accept before timing out the connection
Incoming
An incoming connection for which the server has not yet begun its parts of the handshake.
IncomingAlpns
Iterator over ALPN protocol names from a TLS ClientHello
IncomingZeroRtt
Marker type for a connection that is in the incoming 0-RTT state.
Keys
A complete set of keys for a certain packet space
MtuDiscoveryConfig
noq types that are used in the public iroh API. Parameters governing MTU discovery.
NetReportConfig
Configuration for the net report component.
OpenBi
noq types that are used in the public iroh API. Future produced by [Connection::open_bi]
OpenUni
noq types that are used in the public iroh API. Future produced by [Connection::open_uni]
OutgoingZeroRtt
Marker type for a connection that is in the outgoing 0-RTT state.
Path
A single path within a PathList snapshot.
PathEventStream
A 'static stream of PathEvents.
PathId
Id representing different paths when using multipath extension
PathList
A borrowed snapshot of a connection’s currently-open paths.
PathListIter
An iterator over the open paths in a PathList snapshot.
PathListStream
A stream of PathList snapshots for a connection.
PathStats
noq types that are used in the public iroh API. Statistics related to a transmission path.
QlogConfigqlog
Configuration for qlog trace logging.
QlogFileFactoryqlog
Enables writing qlog traces to a directory.
QuicTransportConfig
Parameters governing the core QUIC state machine
QuicTransportConfigBuilder
Builder for a QuicTransportConfig.
ReadDatagram
noq types that are used in the public iroh API. Future produced by [Connection::read_datagram]
ReadManyDatagrams
noq types that are used in the public iroh API. Future produced by [Connection::read_many_datagrams]
RecvStream
noq types that are used in the public iroh API. A stream that can only be used to receive data
RelayStatus
Connection status of a single home relay.
RemoteEndpointIdError
RemoteInfo
Information about a remote endpoint.
RetryError
Error for attempting to retry an Incoming which already bears a token from a previous retry
RttEstimator
RTT estimation for a particular network path
SendDatagram
noq types that are used in the public iroh API. Future produced by [Connection::send_datagram_wait]
SendStream
noq types that are used in the public iroh API. A stream that can only be used to send data
ServerConfig
Parameters governing incoming connections
ServerConfigBuilder
A builder for a ServerConfig.
StreamId
noq types that are used in the public iroh API. Identifier for a stream within a particular connection
TokenReuseError
Error for when a validation token may have been reused
TransportAddrInfo
Address of a remote with some metadata
TransportError
Transport-level errors occur when a peer violates the protocol specification
TransportErrorCode
Transport-level error code
TransportParameters
Transport parameters used to negotiate connection-level preferences between peers
UdpStats
Statistics about UDP datagrams transmitted or received on a connection.
UnorderedRecvStream
noq types that are used in the public iroh API. A stream that can be used to receive data out-of-order.
UnsupportedVersion
Error indicating that the specified QUIC version is not supported
ValidationTokenConfig
Configuration for sending and handling validation tokens in incoming connections
VarInt
noq types that are used in the public iroh API. An integer less than 2^62
VarIntBoundsExceeded
noq types that are used in the public iroh API. Error returned when constructing a VarInt from a value >= 2^62
WeakConnectionHandle
A weak handle to a Connection.

Enums§

AfterHandshakeOutcome
Outcome of EndpointHooks::after_handshake
AlpnError
AuthenticationError
BeforeConnectOutcome
Outcome of EndpointHooks::before_connect
BindError
ConnectError
ConnectWithOptsError
ConnectingError
ConnectionError
noq types that are used in the public iroh API. Reasons why a connection might be lost
Dir
noq types that are used in the public iroh API. Whether a stream communicates data in both directions or only from the initiator
DirectAddrType
The type of direct address.
EndpointError
FrameType
IncomingAddr
The remote address for an incoming connection.
InvalidSocketAddrNon-wasm_browser
LocalTransportAddr
The local address of a network path.
PathEvent
Lifecycle notifications for a transmission paths in a connection.
PortmapperConfig
Configuration for the portmapper service (UPnP, PCP, NAT-PMP).
QuicConnectError
Errors in the parameters being used to create a new connection
ReadError
noq types that are used in the public iroh API. Errors that arise from reading from a stream.
ReadExactError
noq types that are used in the public iroh API. Errors that arise from reading from a stream.
ReadToEndError
noq types that are used in the public iroh API. Errors from RecvStream::read_to_end
RelayMode
Configuration of the relay servers for an Endpoint.
ResetError
noq types that are used in the public iroh API. Errors that arise while waiting for a stream to be reset
SendDatagramError
noq types that are used in the public iroh API. Errors that can arise when sending a datagram
Side
noq types that are used in the public iroh API. Whether an endpoint was the initiator of a connection
StoppedError
noq types that are used in the public iroh API. Errors that arise while monitoring for a send stream stop from the peer
TransportAddrUsage
Information how a transport address is used.
WriteError
noq types that are used in the public iroh API. Errors that arise from writing to a stream
ZeroRttStatus
Returned from OutgoingZeroRttConnection::handshake_completed.

Constants§

ENV_FORCE_STAGING_RELAYS
Environment variable to force the use of staging relays.

Traits§

ConnectionState
Trait to track the state of a Connection at compile time.
Controller
Common interface for different congestion controllers
ControllerFactory
Constructs controllers on demand
EndpointHooks
EndpointHooks intercept the connection establishment process of an Endpoint.
HandshakeTokenKey
The trait for encrypting tokens that power retry packets and NEW_TOKEN frames.
HeaderKey
Keys used to protect packet headers
PacketKey
Keys used to protect packet payloads
QlogFactoryqlog
Constructs a QlogConfig for individual connections.
TimeSource
Object to get current SystemTime
ToSocketAddrNon-wasm_browser
A simpler version of ToSocketAddrs, that does not do any DNS resolution.
TokenLog
Responsible for limiting clients’ ability to reuse validation tokens

Functions§

default_relay_mode
Returns the default relay mode.
force_staging_infra
Returns true if the use of staging relays is forced.

Type Aliases§

IncomingZeroRttConnection
A QUIC connection on the server-side that can possibly accept 0-RTT data.
OutgoingZeroRttConnection
The client side of a 0-RTT connection.