phpdoc_parser/span.rs
1use serde::Serialize;
2
3/// Half-open byte range into the docblock text.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize)]
5pub struct Span {
6 /// Start byte offset.
7 pub start: u32,
8 /// End byte offset (exclusive).
9 pub end: u32,
10}
11
12impl Span {
13 /// Creates a span from start and end offsets.
14 pub fn new(start: u32, end: u32) -> Self {
15 Self { start, end }
16 }
17}