/// The object is created when the corresponding Envoy network filter config is created, and it is
/// implementation is recommended to implement the [`Drop`] trait to handle the necessary cleanup.
/// This can be used to implement flow control by disabling reads when the write buffer is full.
/// This is used in [`NetworkFilter`] to interact with the underlying Envoy network filter object.
/// Get the write buffer chunks. This is valid after the first on_write callback for the lifetime
/// Returns true if the operation is successful. This can fail if no ObjectFactory is registered
fn get_cluster_host_count(&self, cluster_name: &str, priority: u32) -> Option<ClusterHostCount>;
/// When half-close is enabled, reading a remote half-close will not fully close the connection.
/// When half-close is enabled, reading a remote half-close will not fully close the connection,
/// processing pipeline. For the write buffer, it sets watermarks. When enough data is buffered,
/// [`NetworkFilter::on_scheduled`] is called with the same event id on the worker thread where the
/// The implementation of [`EnvoyNetworkFilterConfig`] for the Envoy network filter configuration.
fn get_cluster_host_count(&self, cluster_name: &str, priority: u32) -> Option<ClusterHostCount> {
unsafe { abi::envoy_dynamic_module_callback_network_filter_set_buffer_limits(self.raw, limit) }
let config_slice = unsafe { std::slice::from_raw_parts(config.ptr as *const _, config.length) };
pub(crate) fn init_network_filter_config<EC: EnvoyNetworkFilterConfig, ENF: EnvoyNetworkFilter>(
/// Caller must ensure `filter_ptr`, `headers`, and `body_chunks` point to valid memory for the