Struct settings::EnvironmentBuilder
source · pub struct EnvironmentBuilder<'a, T: StorageFactory<Storage = DeviceStorage> + Send + Sync + 'static> { /* 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> + Send + Sync + 'static> EnvironmentBuilder<'a, T>
impl<'a, T: StorageFactory<Storage = DeviceStorage> + Send + Sync + 'static> EnvironmentBuilder<'a, T>
sourcepub fn new(storage_factory: Arc<T>) -> Self
pub fn new(storage_factory: Arc<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) -> BoxFuture<'static, ControllerGenerateResult> + Send + Sync>
) -> Self
pub fn handler( self, setting_type: SettingType, generate_handler: Box<dyn Fn(Context) -> BoxFuture<'static, ControllerGenerateResult> + Send + Sync> ) -> 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.
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: &[Arc<dyn Blueprint>]) -> Self
pub fn event_subscribers(self, subscribers: &[Arc<dyn Blueprint>]) -> Self
Event subscribers to participate
sourcepub fn setting_proxy_inspect_info(
self,
setting_proxy_inspect_info: &'a Node,
active_listener_inspect_logger: Arc<Mutex<ListenerInspectLogger>>
) -> Self
pub fn setting_proxy_inspect_info( self, setting_proxy_inspect_info: &'a Node, active_listener_inspect_logger: Arc<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: Arc<FidlStorageFactory> ) -> Self
sourcepub fn spawn(
self,
executor: LocalExecutor,
fs: ServiceFs<ServiceObj<'_, ()>>
) -> Result<(), Error>
pub fn spawn( self, executor: LocalExecutor, fs: ServiceFs<ServiceObj<'_, ()>> ) -> Result<(), Error>
Spawn an [Environment] on the supplied fasync::LocalExecutor so that it may process incoming FIDL requests.