#[non_exhaustive]
pub enum ChannelMethod {
    Direct(Vec<SocketAddr>),
    Pluggable(PtTarget),
}
Expand description

The way to approach a single relay in order to open a channel.

For direct connections, this is simply an address. For connections via a pluggable transport, this includes information about the transport, and any address and settings information that transport requires.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Direct(Vec<SocketAddr>)

Connect to the relay directly at one of several addresses.

§

Pluggable(PtTarget)

Available on crate feature pt-client only.

Connect to a bridge relay via a pluggable transport.

Implementations§

Return all the advertized socket addresses to which this method may connect.

Returns Some(&[]) if there is no way to connect to this target, and None if this target does not use SocketAddr to connect

NOTE that these are not necessarily an address to which you can open a TCP connection! If this ChannelMethod is using a non-Direct transport, then this address will be interpreted by that transport’s implementation.

Return a BridgeAddr that this ChannelMethod uses.

Return true if this is a method for a direct connection.

Return an identifier for the Transport to be used by this ChannelMethod.

Change this ChannelMethod by removing every socket address that does not satisfy pred.

Hostname and None addresses are never removed.

Return an error if we have removed every address.

Return true if every method to contact self is also a method to contact other.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Return the addresses listed for this server. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more