/// The callout result will be delivered to the [`BootstrapExtensionConfig::on_http_callout_done`]
/// The timer is not armed upon creation. Call [`EnvoyBootstrapExtensionTimer::enable`] to arm it.
/// [`BootstrapExtensionConfig::on_cluster_removal`] callbacks when clusters are added, updated,
/// [`BootstrapExtensionConfig::on_listener_removal`] callbacks when listeners are added, updated,
/// The object is created when the corresponding Envoy bootstrap extension config is created, and
/// it is dropped when the corresponding Envoy bootstrap extension config is destroyed. Therefore,
/// Implementations must also be `Send + Sync` since they may be accessed from multiple threads.
/// [`EnvoyBootstrapExtensionConfigScheduler::commit`] to distinguish multiple scheduled events.
/// * `response_headers` is a list of key-value pairs of the response headers. This is optional.
/// * `timer` is a non-owning reference to the timer that fired. The module can re-arm the timer
/// [`EnvoyBootstrapExtensionConfig::enable_listener_lifecycle`]. The callback is invoked on the
/// [`EnvoyBootstrapExtensionConfig::enable_listener_lifecycle`]. The callback is invoked on the
/// This trait must be implemented by the module to handle bootstrap extension lifecycle events.
fn on_worker_thread_initialized(&mut self, _envoy_extension: &mut dyn EnvoyBootstrapExtension) {}
/// This is called on the main thread before workers are stopped. The module can still make HTTP
/// signal completion by calling [`CompletionCallback::done`] when it has finished cleanup. Envoy
/// If the [`CompletionCallback`] is dropped without calling `done`, it will automatically signal
impl EnvoyBootstrapExtensionConfigScheduler for Box<dyn EnvoyBootstrapExtensionConfigScheduler> {
/// [`BootstrapExtensionConfig::on_timer_fired`]. All methods must be called on the main thread.
/// [`BootstrapExtensionConfig::on_timer_fired`] callback by comparing the id of the fired timer
envoy_extension_config_ptr: abi::envoy_dynamic_module_type_bootstrap_extension_config_envoy_ptr,
let config_slice = unsafe { std::slice::from_raw_parts(config.ptr as *const _, config.length) };
/// Event hook called by Envoy when an HTTP callout initiated by a bootstrap extension completes.
/// must ensure that all pointers are valid and that the memory they point to remains valid for
Some(unsafe { std::slice::from_raw_parts(body_chunks as *const EnvoyBuffer, body_chunks_size) })
/// must ensure that all pointers are valid and that the memory they point to remains valid for