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 ComponentDecl
s.
Required Associated Types§
type Model: RoutingTestModel
Required Methods§
Sourcefn new(
root_component: &str,
components: Vec<(&'static str, ComponentDecl)>,
) -> Self
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”.
Sourcefn set_namespace_capabilities(&mut self, caps: Vec<CapabilityDecl>)
fn set_namespace_capabilities(&mut self, caps: Vec<CapabilityDecl>)
Set the capabilities that should be available from the top instance’s namespace.
Sourcefn set_builtin_capabilities(&mut self, caps: Vec<CapabilityDecl>)
fn set_builtin_capabilities(&mut self, caps: Vec<CapabilityDecl>)
Set the capabilities that should be available as built-in capabilities.
Sourcefn register_mock_builtin_runner(&mut self, runner: &str)
fn register_mock_builtin_runner(&mut self, runner: &str)
Register a mock runner
in the built-in environment.
Sourcefn add_capability_policy(
&mut self,
key: CapabilityAllowlistKey,
allowlist: HashSet<AllowlistEntry>,
)
fn add_capability_policy( &mut self, key: CapabilityAllowlistKey, allowlist: HashSet<AllowlistEntry>, )
Add a custom capability security policy to restrict routing of certain caps.
Sourcefn add_debug_capability_policy(
&mut self,
key: DebugCapabilityKey,
allowlist: HashSet<DebugCapabilityAllowlistEntry>,
)
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.
Sourcefn set_component_id_index_path(&mut self, path: Utf8PathBuf)
fn set_component_id_index_path(&mut self, path: Utf8PathBuf)
Sets the path to the component ID index for the test model.
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.