pub fn chrono_to_timestamp(dt: DateTime<Utc>) -> TimestampExpand description
Convert a chrono::DateTime<Utc> to a [google.protobuf.Timestamp].
§Safety of the subsec cast
chrono guarantees timestamp_subsec_nanos() is always < 1_000_000_000,
so the as i32 truncation is lossless and the as u32 → i32 reinterpret
cannot overflow.
§Example
use api_bones::connect::chrono_to_timestamp;
let ts = chrono_to_timestamp(chrono::Utc::now());
assert!(ts.seconds >= 0);