ragkit-ai 0.0.2

Rusty tools for AI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{
  Deserialize,
  Serialize,
};

/// The location in a corresponding string. Inclusive of `start`, exclusive of
/// `end`.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct Loc {
  pub start: usize,
  pub end: usize,
}

impl Loc {
  pub fn as_tuple(&self) -> (usize, usize) {
    (self.start, self.end)
  }
}