perl_workspace/api.rs
1//! Unified public API surface for `perl-workspace-index`.
2//!
3//! This module defines the crate's stable "import once" entry-point for callers
4//! that only need discovery, folder parsing, and ignore-policy helpers.
5//! Re-exports are intentionally explicit (no glob exports) so generated docs stay
6//! navigable and type conflicts are avoided.
7//!
8//! # Why a dedicated API module?
9//!
10//! `monitoring` and `state_machine` both expose similarly named types
11//! (`IndexStateKind`, `DegradationReason`, etc.). Re-exporting everything from
12//! crate root would create ambiguous imports for downstream crates. By keeping a
13//! curated public surface in `api`, consumers can opt into just the common
14//! workspace-bootstrap utilities without pulling in overlapping lifecycle types.
15//!
16//! # Typical usage
17//!
18//! ```rust
19//! use perl_workspace_index::api::{
20//! discover_perl_files, extract_workspace_folder_uris, is_skipped_dir_name,
21//! };
22//!
23//! let _folders = extract_workspace_folder_uris(&[]);
24//! let _is_noise = is_skipped_dir_name("target");
25//! let _result = discover_perl_files(std::path::Path::new("."));
26//! ```
27
28// Discovery public API
29pub use crate::discovery::{
30 DiscoveryMethod, DiscoveryResult, discover_perl_files, is_perl_discovery_path,
31};
32
33// Folder public API
34pub use crate::folder::{
35 WorkspaceFolderChange, extract_workspace_folder_change, extract_workspace_folder_uris,
36 root_path_to_file_uri, workspace_folder_to_path,
37};
38
39// Ignore public API
40pub use crate::ignore::{is_skipped_dir_name, path_contains_skipped_component};