1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Dante Doménech Martinez dante19031999@gmail.com
use crateServiceError;
use crateFallback;
use crate::;
use Any;
/// The [`Service`] trait defines the core execution logic for a logging backend.
///
/// A [`Service`] acts as the internal "Worker" or "Driver" sitting behind a [`LoggerImpl`][`crate::LoggerImpl`].
/// While the logger handles the frontend API and message queuing, the [`Service`] is responsible
/// for the actual side effects, such as disk I/O, network transmission, or database insertion.
///
/// ### Hierarchy & Resilience
/// This trait extends [`Fallback`]. Every implementation must provide a mechanism to handle
/// messages that fail to be processed after the service's internal retry logic has been exhausted.
///
/// ### Threading Model
/// Implementations are typically executed within a dedicated background thread. Therefore,
/// any state held by a [`Service`] must be thread-safe (`Send + Sync`) to ensure
/// consistent behavior across the asynchronous boundary.
///
///