pub struct LogFileRotatedEvent { /* private fields */ }Expand description
Log file rotation event.
Emitted when the file tailer detects that Player.log was replaced
(MTGA restart). The payload contains previous_file_size — the byte
offset in the old file at the time rotation was detected.
Unlike parsed log events, raw_bytes in the metadata is empty and
the timestamp reflects when the rotation was detected (wall-clock),
not a timestamp parsed from the log.
Implementations§
Source§impl LogFileRotatedEvent
impl LogFileRotatedEvent
Sourcepub fn new(metadata: EventMetadata, payload: Value) -> Self
pub fn new(metadata: EventMetadata, payload: Value) -> Self
Constructs a new event with the given metadata and payload.
Sourcepub fn metadata(&self) -> &EventMetadata
pub fn metadata(&self) -> &EventMetadata
Returns the shared event metadata.
Source§impl LogFileRotatedEvent
impl LogFileRotatedEvent
Sourcepub fn for_rotation(timestamp: DateTime<Utc>, previous_file_size: u64) -> Self
pub fn for_rotation(timestamp: DateTime<Utc>, previous_file_size: u64) -> Self
Creates a rotation event with the given detection timestamp and the byte offset in the old file.
Sourcepub fn previous_file_size(&self) -> Option<u64>
pub fn previous_file_size(&self) -> Option<u64>
Returns the byte offset in the old file when rotation was detected.
Returns None only if the payload was manually constructed without
the previous_file_size field (not expected in normal usage).
Trait Implementations§
Source§impl Clone for LogFileRotatedEvent
impl Clone for LogFileRotatedEvent
Source§fn clone(&self) -> LogFileRotatedEvent
fn clone(&self) -> LogFileRotatedEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogFileRotatedEvent
impl Debug for LogFileRotatedEvent
Source§impl<'de> Deserialize<'de> for LogFileRotatedEvent
impl<'de> Deserialize<'de> for LogFileRotatedEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LogFileRotatedEvent
impl PartialEq for LogFileRotatedEvent
Source§fn eq(&self, other: &LogFileRotatedEvent) -> bool
fn eq(&self, other: &LogFileRotatedEvent) -> bool
self and other values to be equal, and is used by ==.