ts_derp 0.4.0

tailscale derp client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};

use crate::frame::{Body, FrameType};

/// Response to a server [`Ping`][crate::frame::Ping] containing the same payload.
#[derive(Debug, Copy, Clone, PartialEq, KnownLayout, Immutable, IntoBytes, FromBytes)]
#[repr(C)]
pub struct Pong {
    /// The payload to echo back to the server.
    ///
    /// Should be the same data contained in the originating [`Ping`][crate::frame::Ping].
    pub payload: [u8; 8],
}

impl Body for Pong {
    const FRAME_TYPE: FrameType = FrameType::Pong;
}