timber_rust/service/loki/message.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Dante Doménech Martinez dante19031999@gmail.com
3
4#![cfg(feature = "loki")]
5#![cfg_attr(docsrs, doc(cfg(feature = "loki")))]
6
7use std::time::SystemTime;
8
9/// A container for a log message and its assigned metadata.
10///
11/// This struct pairs a generic [`Message`][`crate::Message`] with a specific [`SystemTime`]
12/// generated by the logger's monotonic highwater system. This ensures that
13/// even if multiple messages are generated in the same microsecond, they
14/// maintain a strictly increasing order for Loki.
15pub struct Message {
16 /// The original log content and level.
17 pub message: crate::Message,
18 /// The unique, strictly increasing timestamp for this specific entry.
19 pub timestamp: SystemTime,
20}