mib-rs 0.10.0

SNMP MIB parser and resolver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Tokens produced by the SMI/MIB [`Lexer`](super::Lexer).

use crate::source::SourceRange;
use crate::syntax::SyntaxKind;

/// A single lexed token with its classification and source location.
///
/// Use [`SyntaxKind`] to determine what the token represents, and
/// [`SourceRange`] to index back into its [`SourceDocument`](crate::SourceDocument).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Token {
    /// What kind of token this is (keyword, identifier, literal, etc.).
    pub kind: SyntaxKind,
    /// Byte range in the source text that produced this token.
    pub span: SourceRange,
}