synapto-interface 0.1.0-dev.12

Interface definitions for the Synapto framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::plugin::Plugin;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};

#[doc = " Represents a single visual frame captured from a camera peripheral."]
#[derive(Debug, Clone, Serialize, Deserialize, schemars :: JsonSchema)]
pub struct CameraInputFrame {
    #[doc = " JPEG encoded binary frame data."]
    pub data: Vec<u8>,
}

#[async_trait]
pub trait CameraPlugin: Plugin + Send + Sync {
    async fn start(
        &self,
        video_tx: crate::sync::watch::Sender<crate::camera::CameraInputFrame>,
    ) -> Result<(), String>;
}