#[non_exhaustive]pub struct PointSpec {
pub description: String,
pub deadline: Option<Duration>,
pub fail_closed: bool,
pub budget: Option<Duration>,
pub journaled: bool,
pub relay: Option<Codec>,
pub version: u32,
}Expand description
A point’s declaration: its description and limits, for introspection.
New fields may be added in a minor release: build one with
PointSpec::new and the builder methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.description: StringWhat the point builds, for people and agents reading
Bus::points.
deadline: Option<Duration>The deadline of the point’s listeners that set none themselves;
None takes the kernel’s default.
fail_closed: boolOn a PointKind::Request point, a listener that fails (an
error, a panic, a missed deadline) refuses the request instead of
having its contribution dropped: the emit stops there
(Refusal::failed). Ignored on the other kinds.
budget: Option<Duration>The time one pass of the point’s listeners should take on a
thread (Timings): a pass over it is reported
(OverBudget), never failed. None: no budget.
journaled: boolOn a PointKind::Event point, its events go through the bus’s
journal (Journal): published with a number,
delivered to the listeners in journal order after the publisher
has moved on.
relay: Option<Codec>How the point crosses a process (Relay): on a
journaled event point, how its input is written; on a request
point, its input and value (Codec::request),
so another process may ask it (Relay::answer).
None: it stays in this one.
version: u32The point’s version, from 1: raised when its payload changes in a
way an older reader cannot use (a field it may ignore is not such
a change). Two processes cross a point only at the same version
(IngestError::Version).
Implementations§
Source§impl PointSpec
impl PointSpec
Sourcepub fn new(description: impl Into<String>) -> PointSpec
pub fn new(description: impl Into<String>) -> PointSpec
A point described by description, with the kernel’s deadline.
Sourcepub fn deadline(self, deadline: Duration) -> PointSpec
pub fn deadline(self, deadline: Duration) -> PointSpec
The deadline of the point’s listeners that set none themselves.
Sourcepub fn fail_closed(self) -> PointSpec
pub fn fail_closed(self) -> PointSpec
A listener failure refuses the request (PointSpec::fail_closed).
Sourcepub fn budget(self, budget: Duration) -> PointSpec
pub fn budget(self, budget: Duration) -> PointSpec
The time one pass of the point’s listeners should take
(PointSpec::budget).
Sourcepub fn journaled(self) -> PointSpec
pub fn journaled(self) -> PointSpec
Its events go through the journal (PointSpec::journaled).
Sourcepub fn relayable(self, codec: Codec) -> PointSpec
pub fn relayable(self, codec: Codec) -> PointSpec
Its events cross processes with codec; journaled too
(PointSpec::relay). For an event point: a request uses
PointSpec::relayable_request.
Sourcepub fn relayable_request(self, codec: Codec) -> PointSpec
pub fn relayable_request(self, codec: Codec) -> PointSpec
Another process may ask this request, its input and value written
by codec (Codec::request); fail-closed
too, so no answer in time is a refusal (PointSpec::relay).
Sourcepub fn version(self, version: u32) -> PointSpec
pub fn version(self, version: u32) -> PointSpec
The point’s version (PointSpec::version).