pub async fn create(opts: Options) -> Result<RealmBuilder, Error> {
    let mut builder = RealmBuilder::new().await?;
    builder
        .add_eager_component("test/archivist", ComponentSource::url(opts.archivist_url))
        .await?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.logger.LogSink"),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::directory("config-data", "", fio2::R_STAR_DIR),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.sys2.EventSource"),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(Event::Started, cm_rust::EventMode::Async),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(Event::Stopped, cm_rust::EventMode::Async),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(Event::Running, cm_rust::EventMode::Async),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(
                Event::directory_ready("diagnostics"),
                cm_rust::EventMode::Async,
            ),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(
                Event::capability_requested("fuchsia.logger.LogSink"),
                cm_rust::EventMode::Async,
            ),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.diagnostics.ArchiveAccessor"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.diagnostics.FeedbackArchiveAccessor"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::storage("data", "/data"),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.logger.LogSink"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.logger.Log"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?;
    Ok(builder)
}
/// Creates a new topology for tests with an archivist inside.
Creates a new topology for tests with an archivist inside.
Creates a new topology for tests with an archivist inside .
pub async fn create(opts: Options) -> Result<RealmBuilder, Error> {
    let mut builder = RealmBuilder::new().await?;
    builder
        .add_eager_component("test/archivist", ComponentSource::url(opts.archivist_url))
        .await?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.logger.LogSink"),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::directory("config-data", "", fio2::R_STAR_DIR),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.sys2.EventSource"),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(Event::Started, cm_rust::EventMode::Async),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(Event::Stopped, cm_rust::EventMode::Async),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(Event::Running, cm_rust::EventMode::Async),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(
                Event::directory_ready("diagnostics"),
                cm_rust::EventMode::Async,
            ),
            source: RouteEndpoint::component("test"),
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::Event(
                Event::capability_requested("fuchsia.logger.LogSink"),
                cm_rust::EventMode::Async,
            ),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.diagnostics.ArchiveAccessor"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.diagnostics.FeedbackArchiveAccessor"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::storage("data", "/data"),
            source: RouteEndpoint::AboveRoot,
            targets: vec![RouteEndpoint::component("test/archivist")],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.logger.LogSink"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?
        .add_route(CapabilityRoute {
            capability: Capability::protocol("fuchsia.logger.Log"),
            source: RouteEndpoint::component("test/archivist"),
            targets: vec![RouteEndpoint::AboveRoot],
        })?;
    Ok(builder)
}
pub async fn create ( opts : Options ) -> Result < RealmBuilder , Error > { let mut builder = RealmBuilder :: new ( ) . await ? ; builder . add_eager_component ( " " , ComponentSource :: url ( opts . archivist_url ) ) . await ? . add_route ( CapabilityRoute { capability : Capability :: protocol ( " " ) , source : RouteEndpoint :: AboveRoot , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: directory ( " " , " " , fio2 :: R_STAR_DIR ) , source : RouteEndpoint :: AboveRoot , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: protocol ( " " ) , source : RouteEndpoint :: AboveRoot , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: Event ( Event :: Started , cm_rust :: EventMode :: Async ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: Event ( Event :: Stopped , cm_rust :: EventMode :: Async ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: Event ( Event :: Running , cm_rust :: EventMode :: Async ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: Event ( Event :: directory_ready ( " " ) , cm_rust :: EventMode :: Async , ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: Event ( Event :: capability_requested ( " " ) , cm_rust :: EventMode :: Async , ) , source : RouteEndpoint :: AboveRoot , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: protocol ( " " ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint AboveRoot ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: protocol ( " " ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint AboveRoot ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: storage ( " " , " " ) , source : RouteEndpoint :: AboveRoot , targets : vec ! [ RouteEndpoint component ( " " ) ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: protocol ( " " ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint AboveRoot ] , } ) ? . add_route ( CapabilityRoute { capability : Capability :: protocol ( " " ) , source : RouteEndpoint :: component ( " " ) , targets : vec ! [ RouteEndpoint AboveRoot ] , } ) ? ; Ok ( builder ) }
Creates a new topology for tests with an archivist inside.
Creates a new topology for tests with an archivist inside .
opts
Options
opts
Options