cfgmatic-source 5.0.1

Configuration sources (file, env, memory) for cfgmatic framework
Documentation
//! Internal source entry types for [`SourceCoordinator`](super::SourceCoordinator).

use crate::domain::Source;

/// A boxed source with its priority.
pub(super) type BoxedSource = Box<dyn Source>;

/// Entry in the source registry.
pub(in crate::application) struct SourceEntry {
    pub(in crate::application) source: BoxedSource,
    pub(in crate::application) priority: i32,
    pub(in crate::application) order: usize,
}

impl std::fmt::Debug for SourceEntry {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("SourceEntry")
            .field("priority", &self.priority)
            .field("order", &self.order)
            .field("display_name", &self.source.display_name())
            .finish()
    }
}