1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2024 R3BL LLC. Licensed under Apache License, Version 2.0.
//! Unified trait system for grapheme-aware string and document operations.
//!
//! This module provides traits that enable consistent handling of grapheme clusters
//! across different string and document implementations in this codebase. These traits
//! serve as a common interface for working with Unicode text in a grapheme-cluster-aware
//! manner.
//!
//! ## Purpose
//!
//! The unifying traits in this module are designed to provide:
//!
//! - **Future extensibility**: If additional document storage types are added beyond
//! [`ZeroCopyGapBuffer`], they can implement these traits for seamless integration.
//! - **Generic document operations**: New code can work with document-like structures
//! generically through the [`GraphemeDoc`] and [`GraphemeDocMut`] traits, without being
//! tied to specific implementations.
//! - **Cross-implementation interoperability**: Enables potential interoperability
//! between [`ZeroCopyGapBuffer`] and [`Vec<GCStringOwned>`] if needed, allowing code to
//! work with either storage format.
//!
//! ## Core Traits
//!
//! - [`GraphemeString`]: Single-line grapheme-aware string operations.
//! - [`GraphemeDoc`]: Multi-line document read operations.
//! - [`GraphemeDocMut`]: Multi-line document mutation operations.
//!
//! ## Implementation Status
//!
//! Currently, the editor codebase primarily uses [`ZeroCopyGapBuffer`] as a
//! concrete type for performance and type safety reasons. These traits provide an
//! abstraction layer for future flexibility without requiring immediate migration of
//! existing code.
//!
//! [`ZeroCopyGapBuffer`]: crate::ZeroCopyGapBuffer
// Attach
// Re-export
pub use *;
pub use *;
pub use *;
pub use *;