pub struct PointDecl {
pub id: &'static str,
pub kind: PointKind,
pub description: &'static str,
pub deadline: Option<Duration>,
pub fail_closed: bool,
pub needs: &'static [Capability],
pub budget: Option<Duration>,
/* private fields */
}Expand description
One line of a library’s contract table: a point it declares, built
from the point’s type in a const (PointDecl::of::<DocClose>(…)),
so the application can read what a library will host before building
anything. declare_all declares a table on a bus.
Fields§
§id: &'static strThe point’s id.
kind: PointKindWhat it is for.
description: &'static strWhat it does, for people and agents reading introspection.
deadline: Option<Duration>The deadline of its listeners that set none; None takes the
bus’s.
fail_closed: boolWhether a listener failure refuses the request
(PointSpec::fail_closed).
needs: &'static [Capability]The capabilities the point needs from the bus: declare_all
refuses it on a bus without them.
budget: Option<Duration>The time one pass of its listeners should take
(PointSpec::budget).
Implementations§
Source§impl PointDecl
impl PointDecl
Sourcepub const fn of<P: Point>(description: &'static str) -> PointDecl
pub const fn of<P: Point>(description: &'static str) -> PointDecl
The declaration of the point P, described by description.
Sourcepub const fn deadline(self, deadline: Duration) -> PointDecl
pub const fn deadline(self, deadline: Duration) -> PointDecl
The deadline of its listeners that set none.
Sourcepub const fn fail_closed(self) -> PointDecl
pub const fn fail_closed(self) -> PointDecl
A listener failure refuses the request
(PointSpec::fail_closed).
Sourcepub const fn needs(self, needs: &'static [Capability]) -> PointDecl
pub const fn needs(self, needs: &'static [Capability]) -> PointDecl
The capabilities the point needs from the bus
(.needs(&[Capability::Defer])).
Sourcepub const fn budget(self, budget: Duration) -> PointDecl
pub const fn budget(self, budget: Duration) -> PointDecl
The time one pass of its listeners should take
(PointSpec::budget); reported when over, never failed. It
needs no capability: on a bus without Timings it is only
shown.
Sourcepub fn spec(&self) -> PointSpec
pub fn spec(&self) -> PointSpec
The point’s spec, as Bus::declare_point takes it.