You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: state.rs
    path of file: ./repos/ockam/implementations/rust/ockam/ockam_app_lib/src/api
    
    the code of the file until where you have to start completion: //! The `ApplicationState` is the main communication mechanism between the library and the frontend.
//! The library will send the state update as a read-only event.
//!
//! In order to export `ApplicationState` to the C API but without working directly with C
//! structures, two versions of `ApplicationState` were written, one for rust and one for C.
//! When the rust structure needs to be send to the C API, it is converted to the C structure
/
    
fn local_service_to_c(local_service: rust::LocalService) -> *const c::LocalService {
    let local_service_c = c::LocalService {
        name: to_c_string(local_service.name),
        address: to_c_string(local_service.address),
        port: local_service.port,
        scheme: to_optional_c_string(local_service.scheme),
        shared_with: append_c_terminator(
            local_service
                .shared_with
                .into_iter()
                .map(invitee_to_c)
                .collect::<Vec<_>>(),
        ),
        available: local_service.available as u8,
    };
    Box::into_raw(Box::new(local_service_c))
}