#[non_exhaustive]pub struct PointSpec {
pub description: String,
pub deadline: Option<Duration>,
pub fail_closed: bool,
pub budget: Option<Duration>,
pub facets: Vec<Facet>,
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 (the timings contract): a pass over it is reported
(the timings contract’s OverBudget), never failed. None: no budget.
facets: Vec<Facet>What the declaration says for capability contracts
(Facet): a journaled mark, a codec. Each facet’s
contract is needed (declare_all), and the
implementation of that contract reads it; the core does not.
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 (the crossing contract).
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 facet(self, facet: Facet) -> PointSpec
pub fn facet(self, facet: Facet) -> PointSpec
Adds a facet of a capability contract (PointSpec::facets).
Sourcepub fn has(&self, contract: &Contract) -> bool
pub fn has(&self, contract: &Contract) -> bool
Whether the declaration has a facet of contract.
Sourcepub fn version(self, version: u32) -> PointSpec
pub fn version(self, version: u32) -> PointSpec
The point’s version (PointSpec::version).