pub trait HttpModule {
// Required method
fn module() -> &'static ngx_module_t;
// Provided methods
unsafe extern "C" fn preconfiguration(
_cf: *mut ngx_conf_t,
) -> ngx_int_t { ... }
unsafe extern "C" fn postconfiguration(
_cf: *mut ngx_conf_t,
) -> ngx_int_t { ... }
unsafe extern "C" fn create_main_conf(
cf: *mut ngx_conf_t,
) -> *mut c_void
where Self: HttpModuleMainConf,
Self::MainConf: Default { ... }
unsafe extern "C" fn init_main_conf(
_cf: *mut ngx_conf_t,
_conf: *mut c_void,
) -> *mut c_char
where Self: HttpModuleMainConf,
Self::MainConf: Default { ... }
unsafe extern "C" fn create_srv_conf(
cf: *mut ngx_conf_t,
) -> *mut c_void
where Self: HttpModuleServerConf,
Self::ServerConf: Default { ... }
unsafe extern "C" fn merge_srv_conf(
_cf: *mut ngx_conf_t,
prev: *mut c_void,
conf: *mut c_void,
) -> *mut c_char
where Self: HttpModuleServerConf,
Self::ServerConf: Merge { ... }
unsafe extern "C" fn create_loc_conf(
cf: *mut ngx_conf_t,
) -> *mut c_void
where Self: HttpModuleLocationConf,
Self::LocationConf: Default { ... }
unsafe extern "C" fn merge_loc_conf(
_cf: *mut ngx_conf_t,
prev: *mut c_void,
conf: *mut c_void,
) -> *mut c_char
where Self: HttpModuleLocationConf,
Self::LocationConf: Merge { ... }
}
Expand description
The HTTPModule
trait provides the NGINX configuration stage interface.
These functions allocate structures, initialize them, and merge through the configuration layers.
See https://nginx.org/en/docs/dev/development_guide.html#adding_new_modules for details.
Required Methods§
Sourcefn module() -> &'static ngx_module_t
fn module() -> &'static ngx_module_t
Returns reference to a global variable of type ngx_module_t created for this module.
Provided Methods§
Sourceunsafe extern "C" fn preconfiguration(
_cf: *mut ngx_conf_t,
) -> ngx_int_t
unsafe extern "C" fn preconfiguration( _cf: *mut ngx_conf_t, ) -> ngx_int_t
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Sourceunsafe extern "C" fn postconfiguration(
_cf: *mut ngx_conf_t,
) -> ngx_int_t
unsafe extern "C" fn postconfiguration( _cf: *mut ngx_conf_t, ) -> ngx_int_t
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Sourceunsafe extern "C" fn create_main_conf(
cf: *mut ngx_conf_t,
) -> *mut c_void
unsafe extern "C" fn create_main_conf( cf: *mut ngx_conf_t, ) -> *mut c_void
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Sourceunsafe extern "C" fn init_main_conf(
_cf: *mut ngx_conf_t,
_conf: *mut c_void,
) -> *mut c_char
unsafe extern "C" fn init_main_conf( _cf: *mut ngx_conf_t, _conf: *mut c_void, ) -> *mut c_char
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Sourceunsafe extern "C" fn create_srv_conf(
cf: *mut ngx_conf_t,
) -> *mut c_void
unsafe extern "C" fn create_srv_conf( cf: *mut ngx_conf_t, ) -> *mut c_void
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Sourceunsafe extern "C" fn merge_srv_conf(
_cf: *mut ngx_conf_t,
prev: *mut c_void,
conf: *mut c_void,
) -> *mut c_char
unsafe extern "C" fn merge_srv_conf( _cf: *mut ngx_conf_t, prev: *mut c_void, conf: *mut c_void, ) -> *mut c_char
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Sourceunsafe extern "C" fn create_loc_conf(
cf: *mut ngx_conf_t,
) -> *mut c_void
unsafe extern "C" fn create_loc_conf( cf: *mut ngx_conf_t, ) -> *mut c_void
§Safety
Callers should provide valid non-null ngx_conf_t
arguments. Implementers must
guard against null inputs or risk runtime errors.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.