pub struct HttpModule {
pub plugin_id: PluginId,
pub router: Router,
pub operation_ids: BTreeSet<String>,
pub max_request_body_bytes: Option<usize>,
pub header_policy: HttpHeaderPolicy,
}Expand description
One fully state-bound Axum router contributed by a statically linked plugin.
minco-core remains independent of Axum. HTTP-aware plugins contribute this
type through PluginContext::contributions, and the application composition
root validates and merges all modules after plugin installation.
Fields§
§plugin_id: PluginId§router: Router§operation_ids: BTreeSet<String>OpenAPI/descriptor operation IDs implemented by this router fragment.
Minco validates the union of these IDs against the operations declared by the plugin descriptor. The field does not attempt to introspect Axum’s router internals; ownership remains explicit and machine-readable.
max_request_body_bytes: Option<usize>Largest request body accepted by any route in this module.
The application composition root uses this value to prevent a global Tower body limit from accidentally rejecting a route-specific upload limit. Individual routes must still configure their own smaller limits.
header_policy: HttpHeaderPolicyExact header policy required only when this module is installed.
Implementations§
Source§impl HttpModule
impl HttpModule
pub const fn new(plugin_id: PluginId, router: Router) -> Self
Sourcepub fn with_operations<I, S>(self, operation_ids: I) -> Self
pub fn with_operations<I, S>(self, operation_ids: I) -> Self
Declares the contract operations implemented by this module.
pub const fn with_max_request_body_bytes(self, maximum: usize) -> Self
pub fn with_header_policy(self, policy: HttpHeaderPolicy) -> Self
Sourcepub fn contribute(self, context: &mut PluginContext<'_>)
pub fn contribute(self, context: &mut PluginContext<'_>)
Registers this module in deterministic plugin-installation order.
Trait Implementations§
Source§impl Clone for HttpModule
impl Clone for HttpModule
Source§fn clone(&self) -> HttpModule
fn clone(&self) -> HttpModule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more