Module scribe::buffer [] [src]

Types related to in-memory buffers.

Reexports

pub use self::gap_buffer::GapBuffer;
pub use self::cursor::Cursor;

Modules

cursor

Bounds-checked buffer cursor type.

gap_buffer

Buffer type's underlying data structure.

Structs

Buffer

A feature-rich wrapper around an underlying gap buffer.

LineRange

A more concise expression for ranges spanning complete lines.

Position

A two (zero-based) coordinate value representing a location in a buffer. The offset field is so named to emphasize that positions point to locations before/after characters, not characters themselves, in an effort to avoid fencepost errors.

Range

A two-position type, representing a span of characters.

Token

A lexeme and category pairing. Tokens are the final product of a lexer; their lexemes should join to produce the original data passed to the lexer.

Enums

Category

The primary means of classifying a format or language's lexemes.

Functions

from_file

Creates a new buffer by reading the UTF-8 interpreted file contents of the specified path. The buffer's cursor is set to the beginning of the buffer. The buffer data's type will be inferred based on its extension, and an appropriate lexer will be used, if available (see tokens method for further information on why this happens).

new

Creates a new empty buffer. The buffer's cursor is set to the beginning of the buffer.