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