#[non_exhaustive]pub enum BusEvent {
Process {
event: ProcessEventKind,
info: ProcessInfo,
manually: bool,
at_ms: u64,
},
LogOut {
id: u32,
line: String,
},
LogErr {
id: u32,
line: String,
},
Channel {
id: u32,
message: ChildMessage,
},
Dropped {
count: u64,
},
DaemonShutdown,
DogConfigChanged {
dog: String,
},
}Expand description
One event on the daemon bus
Adjacently tagged: event discriminator, data wrapper. Subscription
topics are the dotted strings from BusEvent::topic (process.exit,
log.out, daemon.*); the daemon’s filter globs against them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Process
Lifecycle event for one sheep
LogOut
One stdout line from a sheep
LogErr
One stderr line from a sheep
Channel
One message a sheep wrote on its shepherd channel (fd 3).
Child -> shepherd only: the shepherd’s own writes (a shutdown
message, a dispatched action) are reported elsewhere, by
process.stop and Response::Triggered.
message is the app’s own text, whole and unredacted. The daemon
adds nothing of its own; app-provided text must be safe for every
subscriber, since it is broadcast verbatim.
Fields
message: ChildMessageThe message, exactly as it came off fd 3.
Dropped
The bounded queue dropped this many events for this subscriber
DaemonShutdown
Daemon is shutting down
DogConfigChanged
A dog’s section in dogs.toml changed. Published under
config.dog.<name>, so a dog subscribes to its own name and hears
nobody else’s.
Carries only the dog’s name, nothing else: the bus is a broadcast,
and a [bark] section can hold a webhook URL as a bearer credential
(why DogSectionToml redacts its own Debug). A dog that wants
the values re-asks with
Request::DogConfig, which
answers only that dog’s own section.
Implementations§
Source§impl BusEvent
impl BusEvent
Sourcepub fn topic(&self) -> Cow<'static, str>
pub fn topic(&self) -> Cow<'static, str>
The dotted subscription topic for this event (spec §6 grammar)
A Cow rather than a &'static str, because one topic is not
fixed: Self::DogConfigChanged names its dog in the topic
itself, which is what lets a dog subscribe to its own config and
hear nobody else’s. Every other variant is still a borrowed
literal and allocates nothing.