dmsc_app_builder_new

Function dmsc_app_builder_new 

Source
#[unsafe(no_mangle)]
pub extern "C" fn dmsc_app_builder_new() -> *mut CDMSCAppBuilder
Expand description

Creates a new CDMSCAppBuilder instance.

Initializes an empty application builder ready for component registration. The builder starts with default configuration and no registered modules.

§Returns

Pointer to newly allocated CDMSCAppBuilder on success. Never returns NULL as the implementation uses infallible construction. The returned pointer must be freed using dmsc_app_builder_free().

§Initial State

A newly created builder:

  • Has no registered modules
  • Has no configured middleware
  • Uses default application configuration
  • Has not initiated application startup

§Usage Pattern

CDMSCAppBuilder* builder = dmsc_app_builder_new();
if (builder == NULL) {
    // Handle allocation failure
    return ERROR_MEMORY_ALLOCATION;
}

// Register modules and configure
dmsc_app_builder_register_module(builder, http_module);
dmsc_app_builder_register_module(builder, database_module);

// Build and run
dmsc_app_builder_build(builder);

// Cleanup
dmsc_app_builder_free(builder);