pub struct RelayMap { /* private fields */ }
Available on crate feature
relay
only.Expand description
Configuration of all the relay servers that can be used.
Implementations§
Source§impl RelayMap
impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator
over all known nodes.
Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
pub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap
with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6. If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT
.
Sourcepub fn from_nodes<I: Into<Arc<RelayNode>>>(
value: impl IntoIterator<Item = I>,
) -> Result<Self>
pub fn from_nodes<I: Into<Arc<RelayNode>>>( value: impl IntoIterator<Item = I>, ) -> Result<Self>
Trait Implementations§
impl Eq for RelayMap
impl StructuralPartialEq 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§
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