pub struct PeerInfo {
pub id_init: NodeID,
pub id_follow: NodeID,
pub message: PeerMessage,
}Expand description
Data sent between two nodes using the signalling server to set up a peer-to-peer connection over WebRTC.
Fields§
§id_init: NodeIDThe ID of the node sending the PeerMessage::Init message: the
creator of the outgoing connection
id_follow: NodeIDThe ID of the node receiving the PeerMessage::Init message: the
creator of the incoming connection
message: PeerMessageThe actual data to be sent to the WebRTC subsystem
Implementations§
Source§impl PeerInfo
impl PeerInfo
Sourcepub fn new(init: &NodeID, follow: &NodeID) -> PeerInfo
pub fn new(init: &NodeID, follow: &NodeID) -> PeerInfo
Creates a new PeerInfo with an init message
Sourcepub fn get_remote(&self, local: &NodeID) -> Option<NodeID>
pub fn get_remote(&self, local: &NodeID) -> Option<NodeID>
Gets the other ID given one of the two IDs
Sourcepub fn get_direction(&self, local: &NodeID) -> Direction
pub fn get_direction(&self, local: &NodeID) -> Direction
Gets the direction of the setup given the local ID
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PeerInfo
impl<'de> Deserialize<'de> for PeerInfo
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PeerInfo
Auto Trait Implementations§
impl Freeze for PeerInfo
impl RefUnwindSafe for PeerInfo
impl Send for PeerInfo
impl Sync for PeerInfo
impl Unpin for PeerInfo
impl UnwindSafe for PeerInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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