pub trait FacadeProvider {
// Required methods
fn get_facade(&self, name: &str) -> Option<Arc<dyn Facade>>;
fn get_facades(&self) -> Box<dyn Iterator<Item = &Arc<dyn Facade>> + '_>;
fn get_facade_names(&self) -> Vec<String>;
// Provided methods
fn get_facades_impl<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn execute_impl<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn cleanup_impl(&self) { ... }
fn print_impl(&self) { ... }
fn handle_request<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn run_facade_provider<'life0, 'async_trait>(
&'life0 self,
stream: FacadeProviderRequestStream,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Trait for the implementation of the FacadeProvider protocol.
Required Methods§
Sourcefn get_facade(&self, name: &str) -> Option<Arc<dyn Facade>>
fn get_facade(&self, name: &str) -> Option<Arc<dyn Facade>>
Returns the object implementing Facade for the given facade name.
§Arguments:
- ‘name’ - A string representing the name of the facade.
Sourcefn get_facades(&self) -> Box<dyn Iterator<Item = &Arc<dyn Facade>> + '_>
fn get_facades(&self) -> Box<dyn Iterator<Item = &Arc<dyn Facade>> + '_>
Returns an iterator over all of the Facade implementations.
Sourcefn get_facade_names(&self) -> Vec<String>
fn get_facade_names(&self) -> Vec<String>
Returns an iterator over all of the facade names.
Provided Methods§
Sourcefn get_facades_impl<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_facades_impl<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoked on FacadeProvider.GetFacades(). Sends the list of hosted facades back to the client on subsequent calls to FacadeIterator.GetNext() over the channel given to GetFacades().
§Arguments
- ‘request’ - A request from the FacadeProvider client. Must be a GetFacades() request.
Sourcefn execute_impl<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_impl<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoked on FacadeProvider.Execute(). Executes the given command on a hosted facade.
§Arguments
- ‘request’ - A request from a FacadeProvider client. Must be an Execute() request.
Sourcefn cleanup_impl(&self)
fn cleanup_impl(&self)
Cleans up transient state on all hosted facades. Invoked on FacadeProvider.Cleanup().
Sourcefn print_impl(&self)
fn print_impl(&self)
Prints state for all hosted facades. Invoked on FacadeProvider.Print().
Sourcefn handle_request<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_request<'life0, 'async_trait>(
&'life0 self,
request: FacadeProviderRequest,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoked on each incoming request. Invokes the appropriate handler code.
§Arguments
- ‘request’ - Incoming request on the FacadeProvider connection.
Sourcefn run_facade_provider<'life0, 'async_trait>(
&'life0 self,
stream: FacadeProviderRequestStream,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_facade_provider<'life0, 'async_trait>(
&'life0 self,
stream: FacadeProviderRequestStream,
) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoked on an incoming FacadeProvider connection request. Requests arriving on the stream will be handled concurrently. NOTE: The main SL4F server doesn’t appear to wait before any outstanding requests are completed before allowing a cleanup operation to move forward, and this code similarly makes no such effort. As such, it is up to the test harness to ensure that cleanup and command requests do not interleave in order to ensure that the facades and device remain in a consistent state.
§Arguments
- ‘stream’ - Incoming FacadeProvider request stream.