Expand description
printobserver-vision-api.
Owns: the port external observations arrive through — the trait for
normalizing a received body into an event under the adapter’s own kind, for
retrieving the image one names, and for telling the provider one of its
detections was handled — the shapes those methods carry, that
port’s own error type, and the one event kind this port itself declares:
MalformedExternalEventPayload, a body no adapter could read, written
down.
May depend on: printobserver-types only. A port that named an
implementation would stop being a port.
§This port is normalization, retrieval and acknowledgement only
Ingress transport belongs to the server: nothing here listens, routes or
authenticates. A body arrives here already received, and what leaves is
either a NormalizedAlert or a VisionError saying why one could not
be made. The one thing this port sends the provider is
VisionPort::clear_detection: a detector that paused a print and is never
told the pause was dealt with may stay silent about that print for the rest
of it.
§This port is provider-neutral
A NormalizedAlert carries an EventBody under whatever kind the
adapter declares, and beside it the one thing the supervision domain reads
off an alert: ProviderPrint, the provider’s own identifier for the print
the alert is about. The supervision core correlates on that and never on a
provider’s payload by kind, which is what lets a second provider’s adapter
land without the core hearing of it.
§Why the methods answer a boxed future
Every method is asynchronous, and the trait is dyn-compatible and shareable
across threads, because the supervision core holds every port behind
Arc<dyn Port>. An async fn in a trait is not dyn-compatible, so each
method answers a BoxFuture instead.
Structs§
- Detection
- What a provider’s failure detector did about a print, when an alert is one of its detections.
- Fetched
Image - One image, as it was retrieved.
- Malformed
External Event Payload - An external body arrived that could not be read.
- Normalized
Alert - One external body, read into an event under the adapter’s own kind.
- Provider
Print - The provider’s own identifier for the print an alert is about.
- WebAddress
- An
httporhttpsaddress an image or a provider’s API is reached at, as an operator wrote it down and this port has ruled on it.
Enums§
- Frame
Fault - Why a retrieved frame is not one to hand anybody as a picture of the print.
- Printer
Signal - Something an alert says the printer itself signalled, beside what the detector saw.
- Vision
Error - Why a body could not be read, or an image could not be retrieved.
Constants§
- STATUS_
EXCERPT_ MAX_ BYTES - The most bytes of a refusing answer’s body a
VisionError::Statuscarries.
Traits§
- Vision
Port - The port external observations arrive through.
Functions§
- body_
excerpt - The start of a refusing answer’s body, as the text a
VisionError::Statuscarries.
Type Aliases§
- BoxFuture
- A future this port’s methods answer with, in the one shape a trait object can carry.