pub struct ControlApiClient<T> { /* private fields */ }Expand description
Service allowing to control a media server dynamically, by creating, updating
and destroying pipelines of media Elements on it.
Implementations§
Source§impl<T> ControlApiClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> ControlApiClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ControlApiClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn create(
&mut self,
request: impl IntoRequest<CreateRequest>,
) -> Result<Response<CreateResponse>, Status>
pub async fn create( &mut self, request: impl IntoRequest<CreateRequest>, ) -> Result<Response<CreateResponse>, Status>
Creates a new Element on the media server.
Non-idempotent. Errors if an Element with such ID already exists.
Sourcepub async fn delete(
&mut self,
request: impl IntoRequest<IdRequest>,
) -> Result<Response<Response>, Status>
pub async fn delete( &mut self, request: impl IntoRequest<IdRequest>, ) -> Result<Response<Response>, Status>
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.
Sourcepub async fn get(
&mut self,
request: impl IntoRequest<IdRequest>,
) -> Result<Response<GetResponse>, Status>
pub async fn get( &mut self, request: impl IntoRequest<IdRequest>, ) -> Result<Response<GetResponse>, Status>
Lookups Elements by their FIDs on the media server.
If no FIDs are specified, then returns all the current Elements on the
media server.
Sourcepub async fn apply(
&mut self,
request: impl IntoRequest<ApplyRequest>,
) -> Result<Response<CreateResponse>, Status>
pub async fn apply( &mut self, request: impl IntoRequest<ApplyRequest>, ) -> Result<Response<CreateResponse>, Status>
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.
Trait Implementations§
Source§impl<T> Api for ControlApiClient<T>
impl<T> Api for ControlApiClient<T>
Source§type Error = ControlApiClientError
type Error = ControlApiClientError
ControlApi.Source§fn create<'life0, 'async_trait>(
&'life0 self,
request: ControlRequest,
) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
request: ControlRequest,
) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn apply<'life0, 'async_trait>(
&'life0 self,
request: ControlRequest,
) -> 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,
request: ControlRequest,
) -> Pin<Box<dyn Future<Output = Result<Sids, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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,
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,
Source§impl<T: Clone> Clone for ControlApiClient<T>
impl<T: Clone> Clone for ControlApiClient<T>
Source§fn clone(&self) -> ControlApiClient<T>
fn clone(&self) -> ControlApiClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for ControlApiClient<T>
impl<T> RefUnwindSafe for ControlApiClient<T>where
T: RefUnwindSafe,
impl<T> Send for ControlApiClient<T>where
T: Send,
impl<T> Sync for ControlApiClient<T>where
T: Sync,
impl<T> Unpin for ControlApiClient<T>where
T: Unpin,
impl<T> UnwindSafe for ControlApiClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request