Trait ControlApi

Source
pub trait ControlApi:
    Send
    + Sync
    + 'static {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        request: Request<CreateRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        request: Request<IdRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'async_trait>(
        &'life0 self,
        request: Request<IdRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn apply<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ApplyRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn healthz<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Ping>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Pong>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with ControlApiServer.

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, request: Request<CreateRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a new Element on the media server.

Non-idempotent. Errors if an Element with such ID already exists.

Source

fn delete<'life0, 'async_trait>( &'life0 self, request: Request<IdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes Elements from the media server. Allows referring multiple Elements on the last two levels of a FID.

Idempotent. If no Elements with such FIDs exist, then succeeds.

Source

fn get<'life0, 'async_trait>( &'life0 self, request: Request<IdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lookups Elements by their FIDs on the media server. If no FIDs are specified, then returns all the current Elements on the media server.

Source

fn apply<'life0, 'async_trait>( &'life0 self, request: Request<ApplyRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Applies changes to an existing Element on the media server, or creates a new one in case there is no Element with such ID.

Idempotent. If no Element with such ID exists, then it will be created, otherwise it will be reconfigured. Elements that exist on the same hierarchy level, but are not specified in the provided spec, will be removed.

Source

fn healthz<'life0, 'async_trait>( &'life0 self, request: Request<Ping>, ) -> Pin<Box<dyn Future<Output = Result<Response<Pong>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks healthiness of the media server. Caller should assert that the returned Pong has the same nonce as the sent Ping.

Implementors§

Source§

impl<T> ControlApi for T
where T: ControlApi + Send + Sync + 'static + ?Sized, T::Error: From<ProtobufError>, Error: From<T::Error>,