pub struct RelayMap { /* private fields */ }Expand description
Configuration of all the relay servers that can be used.
Implementations§
Source§impl RelayMap
impl RelayMap
Sourcepub fn urls<T>(&self) -> Twhere
T: FromIterator<RelayUrl>,
pub fn urls<T>(&self) -> Twhere
T: FromIterator<RelayUrl>,
Returns the sorted relay URLs.
Sourcepub fn contains_endpoint(&self, url: &RelayUrl) -> bool
pub fn contains_endpoint(&self, url: &RelayUrl) -> bool
Is this a known endpoint?
Sourcepub fn get_endpoint(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
pub fn get_endpoint(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Get the given endpoint.
Sourcepub fn insert(
&self,
url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
pub fn insert( &self, url: RelayUrl, endpoint: Arc<RelayConfig>, ) -> Option<Arc<RelayConfig>>
Insert a new relay.
Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
pub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by RelayUrl.
Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
fn from(value: RelayConfig) -> Self
Converts to this type from the input type.
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
Creates a value from an iterator. Read more
Source§impl FromIterator<RelayUrl> for RelayMap
impl FromIterator<RelayUrl> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self
Creates a RelayMap from an iterator of [RelayUrl].
The RelayConfigs in the RelayMap will have the default QUIC address
discovery ports.
impl Eq for RelayMap
Auto Trait Implementations§
impl Freeze for RelayMap
impl RefUnwindSafe for RelayMap
impl Send for RelayMap
impl Sync for RelayMap
impl Unpin for RelayMap
impl UnwindSafe for RelayMap
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.