Public declaration syntax from forge-rs/crates/forge-code-safety/src/lease.rs Original source SHA-256: 5c16969d1f368e8013fb1aa77630d4155f41f53a8b48145143c15b8546b1b5ee Function bodies and constant values are omitted. This is not the complete implementation. Source line 58 #[derive(Debug, Clone)] pub struct LeaseRequest { /// The DID of the agent requesting the lease. pub agent_did: String, /// The worktree path to lease. pub worktree_path: PathBuf, /// The write scope the agent is granted. pub write_scope: WriteScope, /// How long the lease should be valid for. pub duration: Duration } Source line 74 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RepoLease { /// Unique identifier for this lease. pub id: String, /// The DID of the agent holding this lease. pub agent_did: String, /// The worktree path this lease covers. pub worktree_path: PathBuf, /// The write scope granted by this lease. pub write_scope: WriteScope, /// When the lease was acquired. pub acquired_at: DateTime, /// When the lease expires. pub expires_at: DateTime } Source line 91 pub fn is_expired(&self) -> bool; Source line 96 pub fn remaining(&self) -> Duration; Source line 119 pub struct RepoLeaseManager { } Source line 128 pub fn new() -> Self; Source line 145 pub async fn acquire(&self, request: LeaseRequest) -> CodeSafetyResult; Source line 195 pub async fn release(&self, lease_id: &str) -> CodeSafetyResult<()>; Source line 221 pub async fn renew( &self, lease_id: &str, additional_duration: Duration, ) -> CodeSafetyResult; Source line 243 pub async fn is_active(&self, lease_id: &str) -> bool; Source line 252 pub async fn get_by_agent(&self, agent_did: &str) -> Option; Source line 261 pub async fn get_by_path(&self, worktree_path: &PathBuf) -> Option; Source line 273 pub async fn list_active(&self) -> Vec; Source line 285 pub async fn cleanup_expired(&self) -> usize;