geno 0.6.1

A cross-language schema compiler that generates type definitions and serialization code from a simple, declarative schema language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};
use std::fmt::Display;

/// A location within a source file
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Location {
    /// The one-based line number of the error.
    pub line: usize,
    /// The one-based column number of the error.
    pub column: usize,
}

impl Display for Location {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}:{}", self.line, self.column)
    }
}