#[non_exhaustive]
pub enum RelayId {
    Ed25519(Ed25519Identity),
    Rsa(RsaIdentity),
}
Expand description

A single relay identity.

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.

Ed25519(Ed25519Identity)

An Ed25519 identity.

Rsa(RsaIdentity)

An RSA identity.

Implementations

Return a RelayIdRef pointing to the contents of this identity.

Try to construct a RelayId of a provided id_type from a byte-slice.

Return RelayIdError::BadLength if the slice is not the correct length for the key.

Return the type of this relay identity.

Return a byte-slice corresponding to the contents of this identity.

The return value discards the type of the identity, and so should be handled with care to make sure that it does not get confused with an identity of some other type.

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

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Creates a value from an iterator. Read more

Try to parse s as a RelayId.

We use the following format, based on the one used by C tor.

  • An optional $ followed by a 40 byte hex string is always an RSA key.
  • A 43 character un-padded base-64 string is always an Ed25519 key.
  • The name of an algorithm (“rsa” or “ed25519”), followed by a colon and and an un-padded base-64 string is a key of that type.

The associated error which can be returned from parsing.

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

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

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

Serialize this value into the given Serde serializer. 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.

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

Converts the given value to a String. 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.