routing_test_helpers

Trait RoutingTestModelBuilder

Source
pub trait RoutingTestModelBuilder {
    type Model: RoutingTestModel;

    // Required methods
    fn new(
        root_component: &str,
        components: Vec<(&'static str, ComponentDecl)>,
    ) -> Self;
    fn set_namespace_capabilities(&mut self, caps: Vec<CapabilityDecl>);
    fn set_builtin_capabilities(&mut self, caps: Vec<CapabilityDecl>);
    fn register_mock_builtin_runner(&mut self, runner: &str);
    fn add_capability_policy(
        &mut self,
        key: CapabilityAllowlistKey,
        allowlist: HashSet<AllowlistEntry>,
    );
    fn add_debug_capability_policy(
        &mut self,
        key: DebugCapabilityKey,
        allowlist: HashSet<DebugCapabilityAllowlistEntry>,
    );
    fn set_component_id_index_path(&mut self, path: Utf8PathBuf);
    fn build<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Self::Model> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Builds an implementation of RoutingTestModel from a set of ComponentDecls.

Required Associated Types§

Required Methods§

Source

fn new( root_component: &str, components: Vec<(&'static str, ComponentDecl)>, ) -> Self

Create a new builder. Both string arguments refer to component names, not URLs, ex: “a”, not “test:///a” or “test:///a_resolved”.

Source

fn set_namespace_capabilities(&mut self, caps: Vec<CapabilityDecl>)

Set the capabilities that should be available from the top instance’s namespace.

Source

fn set_builtin_capabilities(&mut self, caps: Vec<CapabilityDecl>)

Set the capabilities that should be available as built-in capabilities.

Source

fn register_mock_builtin_runner(&mut self, runner: &str)

Register a mock runner in the built-in environment.

Source

fn add_capability_policy( &mut self, key: CapabilityAllowlistKey, allowlist: HashSet<AllowlistEntry>, )

Add a custom capability security policy to restrict routing of certain caps.

Source

fn add_debug_capability_policy( &mut self, key: DebugCapabilityKey, allowlist: HashSet<DebugCapabilityAllowlistEntry>, )

Add a custom debug capability security policy to restrict routing of certain caps.

Source

fn set_component_id_index_path(&mut self, path: Utf8PathBuf)

Sets the path to the component ID index for the test model.

Source

fn build<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Self::Model> + Send + 'async_trait>>
where Self: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§