Struct crystalorb::clocksync::ClockSyncMessage[][src]

pub struct ClockSyncMessage {
    pub client_send_seconds_since_startup: f64,
    pub server_seconds_since_startup: f64,
    pub client_id: usize,
}
Expand description

A message sent between client and server to measure the number of seconds difference between the clocks of the two machines.

  1. The client first sends this structure to the server, ignoring the server_seconds_since_startup and client_id fields. The client_send_seconds_since_startup records the client’s local time that this message was prepared and sent.
  2. The server sends back this structure to the client, preserving the same client_send_seconds_since_startup value as it received, but populating the remaining client_id and server_seconds_since_startup values. The server_seconds_since_startup is the server’s local time at which it prepared and sent this message back to the client.

Fields

client_send_seconds_since_startup: f64

The time (in seconds) when the client side sends this ClockSyncMessage request to the server.

server_seconds_since_startup: f64

The time (in seconds) when the server side sends this ClockSyncMessage back to the client as a reply to the client’s request.

client_id: usize

The client_id that shouldn’t really belong here, but is tagging along for the ride. This is set by the server as part of the server’s reply as well, and is set to the identifier that the server has allocated for the client that has made the request.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more