pub struct EnvironmentBuilder<'a, T: StorageFactory<Storage = DeviceStorage>> { /* private fields */ }
Expand description
The EnvironmentBuilder aggregates the parameters surrounding an environment and ultimately spawns an environment based on them.
Implementations§
Source§impl<'a, T: StorageFactory<Storage = DeviceStorage> + 'static> EnvironmentBuilder<'a, T>
impl<'a, T: StorageFactory<Storage = DeviceStorage> + 'static> EnvironmentBuilder<'a, T>
Sourcepub fn new(storage_factory: Rc<T>) -> Self
pub fn new(storage_factory: Rc<T>) -> Self
Construct a new EnvironmentBuilder using storage_factory
to construct the storage for
the future [Environment].
Sourcepub fn handler(
self,
setting_type: SettingType,
generate_handler: Box<dyn Fn(Context) -> LocalBoxFuture<'static, ControllerGenerateResult>>,
) -> Self
pub fn handler( self, setting_type: SettingType, generate_handler: Box<dyn Fn(Context) -> LocalBoxFuture<'static, ControllerGenerateResult>>, ) -> Self
Overrides the default [GenerateHandler] for a specific SettingType.
Sourcepub fn service(self, generate_service: GenerateService) -> Self
pub fn service(self, generate_service: GenerateService) -> Self
A service generator to be used as an overlay on the ServiceContext.
Sourcepub fn configuration(self, configuration: ServiceConfiguration) -> Self
pub fn configuration(self, configuration: ServiceConfiguration) -> Self
A preset configuration to load preset parameters as a base. Note that this will override any configuration modifications made by [EnvironmentBuilder::fidl_interface], [EnvironmentBuilder::policies], and EnvironmentBuilder::flags.
pub fn display_configuration( self, display_configuration: DefaultSetting<DisplayConfiguration, &'static str>, ) -> Self
pub fn audio_configuration( self, audio_configuration: DefaultSetting<AudioInfo, &'static str>, ) -> Self
pub fn input_configuration( self, input_configuration: DefaultSetting<InputConfiguration, &'static str>, ) -> Self
pub fn light_configuration( self, light_configuration: DefaultSetting<LightHardwareConfiguration, &'static str>, ) -> Self
Sourcepub fn fidl_interfaces(self, interfaces: &[Interface]) -> Self
pub fn fidl_interfaces(self, interfaces: &[Interface]) -> Self
Will override all fidl interfaces in the ServiceConfiguration.
Sourcepub fn registrants(self, registrants: Vec<Registrant>) -> Self
pub fn registrants(self, registrants: Vec<Registrant>) -> Self
Appends the [Registrant]s to the list of registrants already configured.
Sourcepub fn settings(self, settings: &[SettingType]) -> Self
pub fn settings(self, settings: &[SettingType]) -> Self
Setting types to participate.
Sourcepub fn flags(self, controller_flags: &[ControllerFlag]) -> Self
pub fn flags(self, controller_flags: &[ControllerFlag]) -> Self
Setting types to participate with customized controllers.
Sourcepub fn agents(self, registrars: Vec<AgentCreator>) -> Self
pub fn agents(self, registrars: Vec<AgentCreator>) -> Self
Appends the supplied [AgentRegistrar]s to the list of agent registrars.
Sourcepub fn event_subscribers(self, subscribers: &[Rc<dyn Blueprint>]) -> Self
pub fn event_subscribers(self, subscribers: &[Rc<dyn Blueprint>]) -> Self
Event subscribers to participate
Sourcepub fn setting_proxy_inspect_info(
self,
setting_proxy_inspect_info: &'a Node,
active_listener_inspect_logger: Rc<Mutex<ListenerInspectLogger>>,
) -> Self
pub fn setting_proxy_inspect_info( self, setting_proxy_inspect_info: &'a Node, active_listener_inspect_logger: Rc<Mutex<ListenerInspectLogger>>, ) -> Self
Sets the inspect node for setting proxy inspect information and any required inspect loggers.
pub fn storage_dir(self, storage_dir: DirectoryProxy) -> Self
pub fn store_proxy(self, store_proxy: StoreProxy) -> Self
pub fn fidl_storage_factory( self, fidl_storage_factory: Rc<FidlStorageFactory>, ) -> Self
Sourcepub fn spawn(
self,
executor: LocalExecutor,
fs: ServiceFs<ServiceObjLocal<'_, ()>>,
) -> Result<(), Error>
pub fn spawn( self, executor: LocalExecutor, fs: ServiceFs<ServiceObjLocal<'_, ()>>, ) -> Result<(), Error>
Spawn an [Environment] on the supplied fasync::LocalExecutor so that it may process incoming FIDL requests.