pub struct ResourceChecker { /* private fields */ }Expand description
Cross-resource conflict checker
Checks for conflicts between:
- File locks and build/test operations
- Build/test operations and file writes
- Git operations and file/build operations
Implementations§
Source§impl ResourceChecker
impl ResourceChecker
Sourcepub fn new(
file_locks: Arc<FileLockManager>,
resource_locks: Arc<ResourceLockManager>,
) -> Self
pub fn new( file_locks: Arc<FileLockManager>, resource_locks: Arc<ResourceLockManager>, ) -> Self
Create a new resource checker
Sourcepub fn with_operation_tracker(
file_locks: Arc<FileLockManager>,
resource_locks: Arc<ResourceLockManager>,
operation_tracker: Arc<OperationTracker>,
) -> Self
pub fn with_operation_tracker( file_locks: Arc<FileLockManager>, resource_locks: Arc<ResourceLockManager>, operation_tracker: Arc<OperationTracker>, ) -> Self
Create a resource checker with operation tracker integration
Sourcepub fn with_source_patterns(self, patterns: Vec<String>) -> Self
pub fn with_source_patterns(self, patterns: Vec<String>) -> Self
Set custom source file patterns for build conflict detection
Sourcepub async fn can_start_build(
&self,
scope: &ResourceScope,
agent_id: &str,
) -> ConflictCheck
pub async fn can_start_build( &self, scope: &ResourceScope, agent_id: &str, ) -> ConflictCheck
Check if a build can start (no active file write locks in project)
Returns Clear if no source files are being edited,
or Blocked with details of which files are locked.
Sourcepub async fn can_write_file(&self, path: &Path, agent_id: &str) -> ConflictCheck
pub async fn can_write_file(&self, path: &Path, agent_id: &str) -> ConflictCheck
Check if a file can be written (no active build/test in project)
Returns Clear if no build/test is running,
or Blocked with details of the blocking operation.
Sourcepub async fn can_start_git_operation(
&self,
git_op: ResourceType,
scope: &ResourceScope,
agent_id: &str,
) -> ConflictCheck
pub async fn can_start_git_operation( &self, git_op: ResourceType, scope: &ResourceScope, agent_id: &str, ) -> ConflictCheck
Check if a git operation can start
Git operations are blocked by:
- Active file write locks (for operations that read working tree)
- Active builds (for commit/push operations)
Sourcepub async fn check_conflicts(
&self,
operation: &ProposedOperation,
) -> ConflictCheck
pub async fn check_conflicts( &self, operation: &ProposedOperation, ) -> ConflictCheck
Check all conflicts for a proposed operation
Sourcepub async fn get_build_blockers(
&self,
scope: &ResourceScope,
agent_id: &str,
) -> Vec<Conflict>
pub async fn get_build_blockers( &self, scope: &ResourceScope, agent_id: &str, ) -> Vec<Conflict>
Get all current conflicts that would block a build
Auto Trait Implementations§
impl Freeze for ResourceChecker
impl !RefUnwindSafe for ResourceChecker
impl Send for ResourceChecker
impl Sync for ResourceChecker
impl Unpin for ResourceChecker
impl UnsafeUnpin for ResourceChecker
impl !UnwindSafe for ResourceChecker
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