Struct magic_wormhole::transit::RelayHint
source · [−]pub struct RelayHint {
pub name: Option<String>,
pub tcp: HashSet<DirectHint>,
pub ws: HashSet<Url>,
}Expand description
Hint describing a relay server
A server may be reachable at multiple locations. Any two must be relayable over that server, therefore a client may pick only one of these per hint.
All locations are URLs, but here they are already deconstructed and grouped by schema out of convenience.
Fields
name: Option<String>Human readable name
tcp: HashSet<DirectHint>TCP endpoints of that relay
ws: HashSet<Url>WebSockets endpoints of that relay
Implementations
sourceimpl RelayHint
impl RelayHint
pub fn new(
name: Option<String>,
tcp: impl IntoIterator<Item = DirectHint>,
ws: impl IntoIterator<Item = Url>
) -> Self
pub fn from_urls(
name: Option<String>,
urls: impl IntoIterator<Item = Url>
) -> Self
pub fn can_merge(&self, other: &Self) -> bool
pub fn merge(self, other: Self) -> Self
pub fn merge_mut(&mut self, other: Self)
pub fn merge_into(self, collection: &mut Vec<RelayHint>)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for RelayHint
impl<'de> Deserialize<'de> for RelayHint
sourcefn deserialize<D>(de: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RelayHint
impl StructuralEq for RelayHint
impl StructuralPartialEq for RelayHint
Auto Trait Implementations
impl RefUnwindSafe for RelayHint
impl Send for RelayHint
impl Sync for RelayHint
impl Unpin for RelayHint
impl UnwindSafe for RelayHint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more