pub trait VisionPort: Send + Sync {
// Required methods
fn normalize(
&self,
body: RawBytes,
content_type: Option<String>,
) -> BoxFuture<'_, Result<NormalizedAlert, VisionError>>;
fn fetch_image(
&self,
source_url: String,
) -> BoxFuture<'_, Result<FetchedImage, VisionError>>;
}Expand description
The port external observations arrive through.
Every method is asynchronous, the trait is dyn-compatible, and it is
shareable across threads, because the supervision core holds it behind
Arc<dyn VisionPort>.
Required Methods§
Sourcefn normalize(
&self,
body: RawBytes,
content_type: Option<String>,
) -> BoxFuture<'_, Result<NormalizedAlert, VisionError>>
fn normalize( &self, body: RawBytes, content_type: Option<String>, ) -> BoxFuture<'_, Result<NormalizedAlert, VisionError>>
Read a received body into this system’s own event vocabulary.
Sourcefn fetch_image(
&self,
source_url: String,
) -> BoxFuture<'_, Result<FetchedImage, VisionError>>
fn fetch_image( &self, source_url: String, ) -> BoxFuture<'_, Result<FetchedImage, VisionError>>
Retrieve the image a source URL names.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".