/// The first argument has [`ProgramInitFunction`] type, and it is called when the dynamic module is
/// The second argument has [`NewHttpFilterConfigFunction`] type, and it is called when the new HTTP
/// resolve by name and call directly, enabling zero-copy cross-module interactions. For example,
/// The `function_ptr` must point to a valid function that remains valid for the lifetime of the
unsafe { abi::envoy_dynamic_module_callback_get_function(str_to_module_buffer(key), &mut ptr) };
/// each other's globals. For example, a bootstrap extension can register a Tokio runtime handle
/// Unlike [`register_function`], the shared data registry allows overwriting an existing entry.
/// If the key already exists, the data pointer is updated and the function returns `true`. This
/// Callers are responsible for agreeing on the data type out-of-band, since the registry stores
/// This accepts the exact same arguments as the `format!` macro, so you can use it to log formatted
/// This accepts the exact same arguments as the `format!` macro, so you can use it to log formatted
/// This accepts the exact same arguments as the `format!` macro, so you can use it to log formatted
/// Log a warning message to Envoy's logging system with [dynamic_modules] Id. Messages won't be
/// This accepts the exact same arguments as the `format!` macro, so you can use it to log formatted
/// This accepts the exact same arguments as the `format!` macro, so you can use it to log formatted
/// Log a critical message to Envoy's logging system with [dynamic_modules] Id. Messages won't be
/// This accepts the exact same arguments as the `format!` macro, so you can use it to log formatted
/// This is called when the dynamic module is loaded, and it must return true on success, and false
/// object representing the filter's per-route configuration. Returning `None` will cause the HTTP
pub(crate) fn bytes_to_module_buffer(b: &[u8]) -> abi::envoy_dynamic_module_type_module_buffer {
/// retrieve it back when the C code calls the destroy function via [`drop_wrapped_c_void_ptr!`].
/// See https://users.rust-lang.org/t/sending-a-boxed-trait-over-ffi/21708 for the exact problem.
// Implementation note: this can be a simple function taking a type parameter, but we have it as
/// This macro is used to drop the Box<dyn T> and the underlying object when the C code calls the
// Implementation note: this cannot be a function as we need to cast as *mut *mut dyn T which is
/// The first argument has [`ProgramInitFunction`] type, and it is called when the dynamic module is
/// The second argument has [`NewNetworkFilterConfigFunction`] type, and it is called when the new
/// The first argument has [`ProgramInitFunction`] type, and it is called when the dynamic module is
/// The remaining arguments are keyword-labeled filter config functions. Omitted filters won't be
/// - `upstream_http_tcp_bridge:` — [`NewUpstreamHttpTcpBridgeConfigFunction`] for upstream HTTP TCP
/// [`NetworkFilterConfig`] object. Returning `None` will cause the network filter configuration to
/// The second argument `name` is the name of the filter configuration as specified in the Envoy
/// The first argument has [`ProgramInitFunction`] type, and it is called when the dynamic module is
/// The second argument has [`NewListenerFilterConfigFunction`] type, and it is called when the new
/// This is called when a new listener filter configuration is created, and it must return a new
/// [`ListenerFilterConfig`] object. Returning `None` will cause the listener filter configuration
/// The second argument `name` is the name of the filter configuration as specified in the Envoy
/// The first argument has [`ProgramInitFunction`] type, and it is called when the dynamic module is
/// The second argument has [`NewUdpListenerFilterConfigFunction`] type, and it is called when the
/// This is called when a new UDP listener filter configuration is created, and it must return a new
/// The second argument `name` is the name of the filter configuration as specified in the Envoy
/// A global variable that holds the factory function to create a new bootstrap extension config.
pub static NEW_BOOTSTRAP_EXTENSION_CONFIG_FUNCTION: OnceLock<NewBootstrapExtensionConfigFunction> =
/// The second argument is the factory function with [`NewBootstrapExtensionConfigFunction`] type.
// =================================================================================================
// =================================================================================================
/// The `envoy_cluster_metrics` parameter provides access to metric-defining and metric-recording
/// fn new_load_balancer(&self, _envoy_lb: &dyn EnvoyClusterLoadBalancer) -> Box<dyn ClusterLb> {
// =================================================================================================
// =================================================================================================
// =================================================================================================
// =================================================================================================
/// The type of the factory function that creates a new upstream HTTP TCP bridge configuration.