Move rust/http-server to rust/netsim-cxx

Test: ninja -C objs netsimd
Change-Id: I019cec2ee565843e5f468cd97043e39270074bea
diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt
index d51c959..0ab484c 100644
--- a/rust/CMakeLists.txt
+++ b/rust/CMakeLists.txt
@@ -13,8 +13,6 @@
 # 3. cargo build
 # 4. bash scripts/format_code.sh
 
-add_subdirectory(http-server)
-
 add_library(netsim-rust-lib INTERFACE)
 target_link_libraries(
   netsim-rust-lib INTERFACE netsim-cxx netsim-cxx-generated frontend-proto
diff --git a/rust/http-server/CMakeLists.txt b/rust/http-server/CMakeLists.txt
deleted file mode 100644
index 7c26938..0000000
--- a/rust/http-server/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-message(STATUS "Adding rust ${CMAKE_CURRENT_LIST_DIR}/Cargo.toml")
-
-# This will automatically register all the tests as well.
-corrosion_import_crate(MANIFEST_PATH Cargo.toml FLAGS --offline --verbose)
-
-if(WIN32)
-  # 1. Set RUST_CXX_NO_EXCEPTIONS preprocesor definition for cxx crate to disable
-  #    compilation error message of "cannot use 'throw' with exceptions".
-  # 2. MSVC uses environment variable "CL" to prepend arguments to the
-  #    command-line arguments. However, we verified MSVC also supports CXXFLAGS,
-  #    which is used by cc crate.
-  # 3. This isn't needed in mac and Linux because corrosion doesn't pass
-  #    -fno-exception flag.
-  corrosion_set_env_vars(http-server CXXFLAGS=/DRUST_CXX_NO_EXCEPTIONS)
-endif()
-
-if(LINUX)
-  # b/260271048
-  corrosion_add_target_rustflags(
-    "http-server" "-Clink-args=-Wl,-rpath,${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
-endif()
diff --git a/rust/http-server/Cargo.toml b/rust/http-server/Cargo.toml
deleted file mode 100644
index 1c989c9..0000000
--- a/rust/http-server/Cargo.toml
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2022 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-[package]
-name = "http-server"
-version = "0.1.0"
-edition = "2021"
-
-[lib]
-crate-type = ["staticlib", "lib"]
-doctest = false
-test = false
-path = "src/lib.rs"
-
-[[bin]]
-name = "http-server-bin" # lib and bin can't share the same name in corrosion.
-path = "src/main.rs"
-
-[dependencies]
diff --git a/rust/http-server/src/main.rs b/rust/http-server/src/main.rs
deleted file mode 100644
index f3d0292..0000000
--- a/rust/http-server/src/main.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
-    http_server::run_frontend_http_server();
-}
diff --git a/rust/http-server/src/404.html b/rust/netsim-cxx/src/404.html
similarity index 100%
rename from rust/http-server/src/404.html
rename to rust/netsim-cxx/src/404.html
diff --git a/rust/http-server/src/lib.rs b/rust/netsim-cxx/src/frontend_http_server.rs
similarity index 96%
rename from rust/http-server/src/lib.rs
rename to rust/netsim-cxx/src/frontend_http_server.rs
index cb2a1dd..ec7e984 100644
--- a/rust/http-server/src/lib.rs
+++ b/rust/netsim-cxx/src/frontend_http_server.rs
@@ -1,10 +1,10 @@
 mod thread_pool;
 
+use crate::frontend_http_server::thread_pool::ThreadPool;
 use std::fs;
 use std::io::prelude::*;
 use std::net::TcpListener;
 use std::net::TcpStream;
-use thread_pool::ThreadPool;
 
 const BUFFER_SIZE: usize = 1024;
 const GET_RESOURCE: &str = "GET /";
diff --git a/rust/http-server/src/thread_pool.rs b/rust/netsim-cxx/src/frontend_http_server/thread_pool.rs
similarity index 100%
rename from rust/http-server/src/thread_pool.rs
rename to rust/netsim-cxx/src/frontend_http_server/thread_pool.rs
diff --git a/rust/netsim-cxx/src/lib.rs b/rust/netsim-cxx/src/lib.rs
index 7b490cc..4a72207 100644
--- a/rust/netsim-cxx/src/lib.rs
+++ b/rust/netsim-cxx/src/lib.rs
@@ -1,4 +1,6 @@
-//! Backend server library.
+//! Netsim cxx libraries.
+
+mod frontend_http_server;
 
 #[cxx::bridge(namespace = "netsim")]
 mod ffi {