#[non_exhaustive]pub struct RelayConfig {
pub url: RelayUrl,
pub quic: Option<RelayQuicConfig>,
pub auth_token: Option<String>,
}Expand description
Information on a specific relay server.
Includes the Url where it can be dialed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url: RelayUrlThe RelayUrl where this relay server can be dialed.
quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
When None, we will not attempt to do QUIC address discovery
with this relay server.
auth_token: Option<String>Optional authorization token sent to the relay.
Set via RelayConfig::with_auth_token.
Implementations§
Source§impl RelayConfig
impl RelayConfig
Sourcepub fn new(url: RelayUrl, quic: Option<RelayQuicConfig>) -> Self
pub fn new(url: RelayUrl, quic: Option<RelayQuicConfig>) -> Self
Creates a new relay configuration with the given URL and optional QUIC config.
Sourcepub fn with_auth_token(self, token: impl Into<String>) -> Self
pub fn with_auth_token(self, token: impl Into<String>) -> Self
Sets an authorization token for this relay.
On native targets, the token is sent as an Authorization: Bearer TOKEN
header on the WebSocket upgrade request.
When compiled to WebAssembly the token is sent as a ?token=TOKEN
query parameter on the upgrade URL, since browsers don’t allow setting
headers on WebSocket requests.
Trait Implementations§
Source§impl Clone for RelayConfig
impl Clone for RelayConfig
Source§fn clone(&self) -> RelayConfig
fn clone(&self) -> RelayConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelayConfig
impl Debug for RelayConfig
Source§impl<'de> Deserialize<'de> for RelayConfig
impl<'de> Deserialize<'de> for RelayConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for RelayConfig
impl Display for RelayConfig
impl Eq for RelayConfig
Source§impl From<RelayConfig> for RelayMap
impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
fn from(value: RelayConfig) -> Self
Source§impl From<RelayUrl> for RelayConfig
impl From<RelayUrl> for RelayConfig
Source§impl FromIterator<RelayConfig> for RelayMap
impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Source§impl Ord for RelayConfig
impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RelayConfig
impl PartialEq for RelayConfig
Source§impl PartialOrd for RelayConfig
impl PartialOrd for RelayConfig
Source§impl Serialize for RelayConfig
impl Serialize for RelayConfig
impl StructuralPartialEq for RelayConfig
Auto Trait Implementations§
impl Freeze for RelayConfig
impl RefUnwindSafe for RelayConfig
impl Send for RelayConfig
impl Sync for RelayConfig
impl Unpin for RelayConfig
impl UnsafeUnpin for RelayConfig
impl UnwindSafe for RelayConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more