| 182 | /// files or locations. |
| 183 | #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] |
| 184 | pub struct Insertion<H> { |
| 185 | /// Vertices that should come before this new content. |
| 186 | /// |
| 187 | /// During application, edges are created FROM each predecessors |
| 188 | /// TO the new span. |
| 189 | pub predecessors: Vec<Position<H>>, |
| 190 | |
| 191 | /// Vertices that should come after this new content. |
| 192 | /// |
| 193 | /// During application, edges are created FROM the new span |
| 194 | /// TO each successors. |
| 195 | pub successors: Vec<Position<H>>, |
| 196 | |
| 197 | /// Flags for the new edges. |
| 198 | /// |
| 199 | /// Typically `EdgeFlags::BLOCK` for file content, or |
| 200 | /// `EdgeFlags::FOLDER` for directory structure. |
| 201 | pub flag: EdgeFlags, |
| 202 | |
| 203 | /// Start offset in the change's content blob (inclusive). |
| 204 | pub start: ChangePosition, |
| 205 | |
| 206 | /// End offset in the change's content blob (exclusive). |
| 207 | pub end: ChangePosition, |
| 208 | |
| 209 | /// The file (inode) this span belongs to. |
| 210 | /// |
| 211 | /// This allows efficient lookup of which file a span is part of. |
| 212 | pub inode: Position<H>, |
| 213 | } |
| 214 | |
| 215 | impl<H> Insertion<H> { |
| 216 | /// Get the length of the content in bytes. |
no outgoing calls