pub struct Flow {
pub source: SocketAddrV4,
pub destination: SocketAddrV4,
}Expand description
One direction of one connection: the key a TCP byte stream is kept under.
The four-tuple and the direction, because the two directions of a dbserver conversation are different message types and interleaving them would produce a byte stream nobody ever sent.
Fields§
§source: SocketAddrV4Who sends on this half of the connection.
destination: SocketAddrV4Who receives.
Implementations§
Source§impl Flow
impl Flow
Sourcepub fn involves(self, port: u16) -> bool
pub fn involves(self, port: u16) -> bool
Whether either endpoint sits on port.
This is the right test for TCP and the wrong one for UDP. A TCP
connection is a thing with two ends, and both directions of a dbserver
conversation belong to the server’s port; a UDP datagram is a thing
with a destination, and its source port says nothing about which
protocol wrote it. See Packet::destination.
Trait Implementations§
impl Copy for Flow
impl Eq for Flow
impl StructuralPartialEq for Flow
Auto Trait Implementations§
impl Freeze for Flow
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnsafeUnpin for Flow
impl UnwindSafe for Flow
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