artifactize_core/
monitor.rs1pub mod catalog;
3pub mod evidence;
4pub mod fold;
5pub mod loader;
6pub mod model;
7pub mod session;
8
9pub use catalog::{Badge, Catalog, CatalogRow, Repository, Scope};
10pub use evidence::{Evidence, EvidenceStamp, evidence, original};
11pub use fold::upstream;
12pub use loader::{Input, Loader, Origin, Page, Snapshot, newer_offset, older_offset};
13pub use model::{
14 Activity, Busy, Card, Clock, Completion, Detail, EvalView, Graph, GraphEdge, GraphNode, Kind,
15 Light, Node, NodeId, NotRun, Progress, Queue, RunRow, Section, Segment, Source, Status, Strip,
16 Target, Tone, Upstream, Waits, Weight, card, counts, detail, duration, glyph, graph, progress,
17 run_node, run_rows, strip, tree, upstream_index,
18};
19
20use crate::workspace::canonical_target;
21use std::{borrow::Cow, path::PathBuf};
22
23pub const PAGE: u32 = 100;
25
26pub fn initial(repo: Option<PathBuf>) -> Option<PathBuf> {
29 repo.map(|path| canonical_target(&path).unwrap_or(path))
30}
31
32pub fn plain(text: &str) -> Cow<'_, str> {
35 if !text.contains(char::is_control) {
36 return Cow::Borrowed(text);
37 }
38 Cow::Owned(
39 text.chars()
40 .filter_map(|character| match character {
41 '\n' | '\t' => Some(' '),
42 character if character.is_control() => None,
43 character => Some(character),
44 })
45 .collect(),
46 )
47}
48
49#[cfg(test)]
50pub(crate) mod tests {
51 pub(crate) use crate::test_request::request;
52}