edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! Live follow: whether the `.edith` the window has open was written on disk by |
| 2 | //! someone else (the agent, through `edith_mcp`) since the window last looked. |
| 3 | //! The decision is a pure function of two stamps and one flag, so it reads and |
| 4 | //! tests without a window; [`crate::Player`] supplies the three inputs. |
| 5 | |
| 6 | use Path; |
| 7 | use SystemTime; |
| 8 | |
| 9 | /// A project file as the window last saw it: when it was written and how long |
| 10 | /// it is. Both must match for a file to count as unchanged. |
| 11 | |
| 12 | pub |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | /// What the window does about one look at the project file. |
| 18 | |
| 19 | pub |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | /// The whole rule. `known` is the stamp the window last accounted for (set on |
| 36 | /// open, on its own save, and when a change has been answered). `now` is the |
| 37 | /// file as it stands. `edited` says the window holds edits the file does not. |
| 38 | /// |
| 39 | /// The window's own save needs no case here: [`crate::Player::save_project`] |
| 40 | /// records the stamp it just wrote as `known`, so its own write reads as `Idle`. |
| 41 | pub |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// The stamp of `path` as it stands, or `None` when there is nothing settled to |
| 52 | /// read: no path, no file, a zero-length file, or a `<path>.part` beside it. The |
| 53 | /// engine writes `<path>.part` and renames it over `path`, so the file is only |
| 54 | /// final once that sibling is gone. |
| 55 | pub |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 |