pub trait ControlApi {
    type Error;

    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        req: Request
    ) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn apply<'life0, 'async_trait>(
        &'life0 self,
        req: Request
    ) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fids: &'life1 [Fid]
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fids: &'life1 [Fid]
    ) -> Pin<Box<dyn Future<Output = Result<Elements, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn healthz<'life0, 'async_trait>(
        &'life0 self,
        ping: Ping
    ) -> Pin<Box<dyn Future<Output = Result<Pong, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

API allowing to control a media server dynamically, by creating, updating and destroying pipelines of media Elements on it.

Both API client and API server should implement this trait.

Required Associated Types§

source

type Error

Error returned by this ControlApi.

Required Methods§

source

fn create<'life0, 'async_trait>( &'life0 self, req: Request ) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + 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.

§Errors
  • If the Element’s parent Element (identified by a Fid) doesn’t exist.
  • If an Element with such ID already exists.
  • If the media server failed to perform this request.
source

fn apply<'life0, 'async_trait>( &'life0 self, req: Request ) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + 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 Request, will be removed.

§Errors
  • If the Element’s parent Element (identified by a Fid) doesn’t exist.
  • If the media server failed to perform this request.
source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, fids: &'life1 [Fid] ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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.

§Errors
  • If no Fids were specified.
  • If any Fid contains multiple room::Ids.
  • If the media server failed to perform this request.
source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, fids: &'life1 [Fid] ) -> Pin<Box<dyn Future<Output = Result<Elements, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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.

If no Element exists for some Fid, then it won’t be present in the returned Elements collection.

§Errors
  • If the media server failed to perform this request.
source

fn healthz<'life0, 'async_trait>( &'life0 self, ping: Ping ) -> Pin<Box<dyn Future<Output = Result<Pong, Self::Error>> + 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.

§Errors
  • If the media server failed to perform this request.

Implementors§