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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Logical object type enumerations for `libvctrl_handler`.
//!
//! # Purpose
//!
//! This module defines high-level, discriminative types that categorize the
//! logical kind of an object in the version control system. Rather than
//! exposing raw filesystem mode bits, it provides a semantic enum
//! ([`EntryKind`]) that distinguishes between regular files, executable
//! files, symbolic links, subdirectories, and submodule references.
//!
//! # Design Rationale
//!
//! The enum is kept separate from the low-level mode constants (like those
//! in [`crate::constants::entry_mode`]) to decouple the abstract data model
//! ("what kind of object is this?") from the serialized Unix-style
//! representation ("what permission bits does this object have?"). This
//! allows different backends to map their own mode systems to a uniform set
//! of logical kinds, and makes the core data structures independent of
//! POSIX-specific details.
//!
//! The module itself is deliberately small; it contains only the enum and
//! its documentation. This avoids pulling in dependencies or bloating the
//! crate with logic that belongs to higher-level components (e.g., a decoder
//! implementation).
//!
//! # Internal Module Structure
//!
//! The module is organized into a `core` submodule that houses the actual
//! enum definition. The re-export at this level lifts [`EntryKind`] into the
//! `enums` namespace, so consumers can write:
//!
//! ```
//! use libvctrl_handler::enums::EntryKind;
//! ```
//!
//! instead of the longer:
//!
//! ```
//! use libvctrl_handler::enums::core::entry_kind::EntryKind;
//! ```
//!
//! This indirection keeps the public API stable even if the internal file
//! layout changes in the future.
//!
//! # How It Relates to Other Crate Items
//!
//! - [`EntryKind`] is used by [`TreeEntry`](crate::TreeEntry) to describe
//! whether an entry points to a blob or a tree.
//! - The `entry_mode` constants in
//! [`crate::constants::entry_mode`] define the raw Unix mode bits that
//! correspond to each logical kind. Decoder and encoder implementations are
//! responsible for translating between the two representations.
//!
//! # Examples
//!
//! Comparing logical kinds:
//!
//! ```
//! use libvctrl_handler::enums::EntryKind;
//!
//! assert_ne!(EntryKind::Blob, EntryKind::Tree);
//! assert_ne!(EntryKind::Executable, EntryKind::Blob);
//! assert_ne!(EntryKind::Symlink, EntryKind::Tree);
//! assert_ne!(EntryKind::Submodule, EntryKind::Tree);
//! ```
/// Re-export of [`EntryKind`] from the internal `core` submodule.
///
/// This public re-export ensures that downstream code can access the enum
/// through the stable path `libvctrl_handler::enums::EntryKind` without
/// depending on the internal module layout.
///
/// # Examples
///
/// ```
/// use libvctrl_handler::enums::EntryKind;
///
/// let kind = EntryKind::Blob;
/// assert_eq!(kind, EntryKind::Blob);
/// ```
pub use EntryKind;