pub struct DependencyValidator { /* private fields */ }
Expand description
Compile-time dependency validator
Implementations§
Source§impl DependencyValidator
impl DependencyValidator
Sourcepub fn new(descriptors: &[ServiceDescriptor]) -> Self
pub fn new(descriptors: &[ServiceDescriptor]) -> Self
Create a new validator from service descriptors
Sourcepub fn validate(&self) -> Result<(), Vec<ValidationError>>
pub fn validate(&self) -> Result<(), Vec<ValidationError>>
Validate all dependencies and return any errors
Sourcepub fn dependency_graph(&self) -> &HashMap<ServiceId, Vec<ServiceId>>
pub fn dependency_graph(&self) -> &HashMap<ServiceId, Vec<ServiceId>>
Get dependency graph for visualization
Sourcepub fn topological_sort(&self) -> Result<Vec<ServiceId>, ValidationError>
pub fn topological_sort(&self) -> Result<Vec<ServiceId>, ValidationError>
Get topologically sorted services
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DependencyValidator
impl RefUnwindSafe for DependencyValidator
impl Send for DependencyValidator
impl Sync for DependencyValidator
impl Unpin for DependencyValidator
impl UnwindSafe for DependencyValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more