use crate::dependency_activity::DependencyActivity;
use crate::dependency_state::DependencyState;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DependencyInfo {
state: DependencyState,
activity: DependencyActivity,
gating: bool,
last_error: Option<String>,
}
impl DependencyInfo {
pub fn new(
state: DependencyState,
activity: DependencyActivity,
gating: bool,
last_error: Option<String>,
) -> Self {
Self {
state,
activity,
gating,
last_error,
}
}
pub fn state(&self) -> DependencyState {
self.state
}
pub fn activity(&self) -> DependencyActivity {
self.activity
}
pub fn gating(&self) -> bool {
self.gating
}
pub fn last_error(&self) -> Option<&str> {
self.last_error.as_deref()
}
}