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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! State management module
//!
//! This module provides the core state management functionality for Regent SDK.
//! It includes types and traits for defining expected states, assessing compliance,
//! and performing remediation.
//!
//! ## Architecture
//!
//! The state management system is built around several key concepts:
//!
//! - **[`ExpectedState`]**: The root container for infrastructure definitions
//! - **[`attribute::Attribute`]**: Individual resource definitions (packages, services, files, etc.)
//! - **[`attribute::AttributeDetail`]**: Enum of all supported resource types
//! - **[`compliance`]**: Types for compliance assessment and status reporting
//!
//! ## Quick Start
//!
//! ```no_run
//! use regent_sdk::state::{ExpectedState, Attribute};
//! use regent_sdk::attribute::system::service::{ServiceBlockExpectedState, ServiceExpectedState};
//! use regent_sdk::Privilege;
//!
//! // Create a service attribute
//! let nginx_service = ServiceBlockExpectedState::builder("nginx")
//! .with_state(ServiceExpectedState::Started)
//! .with_enabled(true)
//! .build()
//! .unwrap();
//!
//! // Create expected state with the attribute
//! let expected_state = ExpectedState::new()
//! .with_attribute(Attribute::service(
//! nginx_service,
//! Privilege::WithSudo,
//! Some("Ensure nginx is running".to_string()),
//! ))
//! .build();
//! ```
use crate::;
pub use ExpectedState;
/// Trait for types that can validate themselves.
///
/// This trait is used throughout the SDK to ensure that configurations
/// are valid before they are used.