Privatize fake sources, drop restating docs, remove boxed iterator in capped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
1 parent
8b3f91dcb7
commit
d5a0373a75
9 files changed
+25
-38
No files matched your search
+11
-12
@@ -1,8 +1,7 @@
|
||||
//! Fixture-backed in-memory sources for tests and for developing surfaces
|
||||
//! without systemd, journald or Docker.
|
||||
//!
|
||||
//! `fake_state(config)` returns a ready `AppState`. Each fake exposes its
|
||||
//! fixtures as public fields so tests can replace them.
|
||||
//! `fake_state(config)` returns a ready `AppState`.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -37,9 +36,9 @@ pub fn fake_state(config: Config) -> AppState {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FakeSystemd {
|
||||
pub units: Vec<UnitStatus>,
|
||||
pub timers: Vec<TimerInfo>,
|
||||
struct FakeSystemd {
|
||||
units: Vec<UnitStatus>,
|
||||
timers: Vec<TimerInfo>,
|
||||
}
|
||||
|
||||
impl Default for FakeSystemd {
|
||||
@@ -125,13 +124,13 @@ impl SystemdSource for FakeSystemd {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FakeJournal {
|
||||
pub entries: Vec<JournalEntry>,
|
||||
struct FakeJournal {
|
||||
entries: Vec<JournalEntry>,
|
||||
shutdown: CancellationToken,
|
||||
}
|
||||
|
||||
impl FakeJournal {
|
||||
pub fn new(shutdown: CancellationToken) -> Self {
|
||||
fn new(shutdown: CancellationToken) -> Self {
|
||||
let e = |t: &str, p: Priority, unit: &str, msg: &str| JournalEntry {
|
||||
timestamp: ts(t),
|
||||
priority: Some(p),
|
||||
@@ -215,14 +214,14 @@ impl JournalSource for FakeJournal {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FakeDocker {
|
||||
pub containers: Vec<ContainerStatus>,
|
||||
pub logs: Vec<LogLine>,
|
||||
struct FakeDocker {
|
||||
containers: Vec<ContainerStatus>,
|
||||
logs: Vec<LogLine>,
|
||||
shutdown: CancellationToken,
|
||||
}
|
||||
|
||||
impl FakeDocker {
|
||||
pub fn new(shutdown: CancellationToken) -> Self {
|
||||
fn new(shutdown: CancellationToken) -> Self {
|
||||
let c = |id: &str, name: &str, state: &str, health: Option<&str>| ContainerStatus {
|
||||
summary: ContainerSummary {
|
||||
id: id.into(),
|
||||
|
||||
Reference in new issue
Block a user