timber_rust/service/aws/
data.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Dante Doménech Martinez dante19031999@gmail.com
3
4#![cfg(feature = "aws")]
5#![cfg_attr(docsrs, doc(cfg(feature = "aws")))]
6
7use crate::service::aws::MessageFormatter;
8use tokio::runtime::Runtime;
9
10/// Shared state and configuration for the Loki service.
11///
12/// This struct is typically wrapped in an [`Arc`][`std::sync::Arc`] to be shared between the
13/// frontend logger and the background worker thread.
14pub struct Data {
15    /// The pre-configured HTTP client (handles connection pooling).
16    pub client: aws_sdk_cloudwatchlogs::Client,
17    /// Internal Tokio runtime used to drive the asynchronous SDK.
18    pub rt: Runtime,
19    /// The target Log Group name in AWS CloudWatch.
20    pub log_group: String,
21    pub formatter: Box<dyn MessageFormatter + Send + Sync>,
22}