feat: awawa

This commit is contained in:
Nova 2024-04-18 15:32:09 -04:00
parent 78d50e42d1
commit 7cdce1acd7
8 changed files with 278 additions and 211 deletions

119
Cargo.lock generated
View file

@ -75,9 +75,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
[[package]]
name = "cc"
version = "1.0.92"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41"
checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7"
[[package]]
name = "cfg-if"
@ -232,6 +232,15 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "glam"
version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945"
dependencies = [
"mint",
]
[[package]]
name = "glam"
version = "0.25.0"
@ -355,7 +364,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -402,7 +411,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -610,9 +619,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.79"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
dependencies = [
"unicode-ident",
]
@ -720,22 +729,22 @@ checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
[[package]]
name = "serde"
version = "1.0.197"
version = "1.0.198"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.197"
version = "1.0.198"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -746,7 +755,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -791,8 +800,8 @@ checksum = "2f2b15926089e5526bb2dd738a2eb0e59034356e06eb71e1cd912358c0e62c4d"
[[package]]
name = "stardust-xr"
version = "0.44.0"
source = "git+https://github.com/StardustXR/core#8fcdf1bbf01d9b31feaae7518b02c7d70348cf0b"
version = "0.45.0"
source = "git+https://github.com/StardustXR/core#21120b8924d2a450f4dd92a022d4df40b7e3885d"
dependencies = [
"cluFlock",
"color-rs",
@ -811,11 +820,12 @@ dependencies = [
[[package]]
name = "stardust-xr-fusion"
version = "0.44.1"
source = "git+https://github.com/StardustXR/core#8fcdf1bbf01d9b31feaae7518b02c7d70348cf0b"
version = "0.45.0"
source = "git+https://github.com/StardustXR/core#21120b8924d2a450f4dd92a022d4df40b7e3885d"
dependencies = [
"color-eyre",
"color-rs",
"glam 0.24.2",
"mint",
"nanoid",
"parking_lot 0.12.1",
@ -832,7 +842,7 @@ dependencies = [
[[package]]
name = "stardust-xr-fusion-codegen"
version = "0.1.0"
source = "git+https://github.com/StardustXR/core#8fcdf1bbf01d9b31feaae7518b02c7d70348cf0b"
source = "git+https://github.com/StardustXR/core#21120b8924d2a450f4dd92a022d4df40b7e3885d"
dependencies = [
"convert_case",
"mint",
@ -844,11 +854,11 @@ dependencies = [
[[package]]
name = "stardust-xr-molecules"
version = "0.44.1"
source = "git+https://github.com/StardustXR/molecules#78462fc9da51dc1b41a2df7d529c654edaf6e6e8"
version = "0.45.0"
source = "git+https://github.com/StardustXR/molecules#263e19e10fb4af839809e4d1f79717247909175c"
dependencies = [
"color-rs",
"glam",
"glam 0.25.0",
"lazy_static",
"lerp",
"map-range",
@ -863,11 +873,11 @@ dependencies = [
[[package]]
name = "stardust-xr-schemas"
version = "1.5.3"
source = "git+https://github.com/StardustXR/core#8fcdf1bbf01d9b31feaae7518b02c7d70348cf0b"
source = "git+https://github.com/StardustXR/core#21120b8924d2a450f4dd92a022d4df40b7e3885d"
dependencies = [
"flatbuffers",
"flexbuffers",
"glam",
"glam 0.25.0",
"kdl",
"manifest-dir-macros",
"mint",
@ -889,9 +899,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.58"
version = "2.0.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687"
checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
dependencies = [
"proc-macro2",
"quote",
@ -915,7 +925,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -955,7 +965,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -994,7 +1004,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.58",
"syn 2.0.60",
]
[[package]]
@ -1095,7 +1105,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.4",
"windows-targets 0.52.5",
]
[[package]]
@ -1115,17 +1125,18 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
dependencies = [
"windows_aarch64_gnullvm 0.52.4",
"windows_aarch64_msvc 0.52.4",
"windows_i686_gnu 0.52.4",
"windows_i686_msvc 0.52.4",
"windows_x86_64_gnu 0.52.4",
"windows_x86_64_gnullvm 0.52.4",
"windows_x86_64_msvc 0.52.4",
"windows_aarch64_gnullvm 0.52.5",
"windows_aarch64_msvc 0.52.5",
"windows_i686_gnu 0.52.5",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.5",
"windows_x86_64_gnu 0.52.5",
"windows_x86_64_gnullvm 0.52.5",
"windows_x86_64_msvc 0.52.5",
]
[[package]]
@ -1136,9 +1147,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
[[package]]
name = "windows_aarch64_msvc"
@ -1148,9 +1159,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
[[package]]
name = "windows_i686_gnu"
@ -1160,9 +1171,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
[[package]]
name = "windows_i686_msvc"
@ -1172,9 +1189,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
[[package]]
name = "windows_x86_64_gnu"
@ -1184,9 +1201,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
[[package]]
name = "windows_x86_64_gnullvm"
@ -1196,9 +1213,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
[[package]]
name = "windows_x86_64_msvc"
@ -1208,9 +1225,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.4"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]]
name = "winnow"

View file

@ -1,13 +1,15 @@
[package]
edition = "2021"
rust-version = "1.75"
name = "color_cube"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
manifest-dir-macros = "0.1.18"
mint = "0.5.9"
tokio = { version = "1.37.0", features = ["full"] }
stardust-xr-fusion = { git = "https://github.com/StardustXR/core" }
stardust-xr-molecules = { git = "https://github.com/StardustXR/molecules" }
tokio = { version = "1.37.0", features = ["full"] }

48
flake.lock generated Normal file
View file

@ -0,0 +1,48 @@
{
"nodes": {
"crane": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713459701,
"narHash": "sha256-LjQ11ASxnv/FXfb8QnrIyMkyqSqcBPX+lFK8gu0jSQE=",
"owner": "ipetkov",
"repo": "crane",
"rev": "45ea0059fb325132fdc3c39faffb0941d25d08d3",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1713248628,
"narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"crane": "crane",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

38
flake.nix Normal file
View file

@ -0,0 +1,38 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:ipetkov/crane";
};
};
outputs = { self, nixpkgs, crane }:
let supportedSystems = [ "aarch64-linux" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
default = crane.lib.${system}.buildPackage {
src = ./.;
STARDUST_RES_PREFIXES = pkgs.stdenvNoCC.mkDerivation {
name = "resources";
src = ./.;
buildPhase = "cp -r $src/res $out";
};
};
});
devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cargo
rustc
];
};
});
};
}

83
src/color_cube.rs Normal file
View file

@ -0,0 +1,83 @@
use stardust_xr_fusion::drawable::Model;
use stardust_xr_fusion::{
client::{Client, FrameInfo},
core::values::{rgba_linear, Color, ResourceID},
fields::BoxField,
input::{InputData, InputHandler, InputHandlerAspect, InputHandlerHandler, InputMethod},
node::NodeType,
spatial::{SpatialAspect, Transform},
HandlerWrapper,
};
use stardust_xr_molecules::{Grabbable, GrabbableSettings};
use std::collections::HashMap;
pub struct ColorCube {
model: Model,
field: BoxField,
handler: InputHandler,
inputs: HashMap<InputData, InputMethod>,
hover_color: Color,
}
impl ColorCube {
pub async fn create(client: &Client) -> HandlerWrapper<InputHandler, Self> {
let model = Model::create(
client.get_root(),
Transform::identity(),
&ResourceID::new_namespaced("color_cube", "color_cube"),
)
.unwrap();
let bounds = model.get_local_bounding_box().await.unwrap();
let field = BoxField::create(&model, Transform::none(), [0.4; 3]).unwrap();
let hover_color = rgba_linear!(0.5, 0.5, 0.5, 1.0);
let handler = InputHandler::create(&model, Transform::none(), &field).unwrap();
let color_cube = ColorCube {
model,
field,
handler: handler.alias(),
inputs: Default::default(),
hover_color,
};
handler.wrap(color_cube).unwrap()
}
pub fn update(&mut self, info: &FrameInfo) {
// for (data, method) in self.inputs.iter() {
// data.datamap.with_data(|data| {
// data.idx("color_hover").as_f32()
// });
// data.captured = true;
// method.capture(&self.handler).unwrap();
// }
self.inputs.clear();
}
// fn hover(size: Vector2<f32>, point: Vector3<f32>) -> bool {
// point.x.abs() < size.x && point.y.abs() < size.y
// }
// fn hover_action(input: &InputData, state: &State) -> bool {
// match &input.input {
// InputDataType::Pointer(_) => input.distance < 0.0,
// InputDataType::Hand(h) => Self::hover(state.size, h.index.tip.position),
// InputDataType::Tip(t) => Self::hover(state.size, t.origin),
// }
// }
// fn hover_point(&self, input: &InputData) -> Vector3<f32> {
// let hover_point = match &input.input {
// InputDataType::Pointer(p) => [0.0; 3].into(),
// InputDataType::Hand(h) => h.index.tip.position,
// InputDataType::Tip(t) => t.origin,
// };
// return hover_point;
// }
}
impl InputHandlerHandler for ColorCube {
fn input(&mut self, input: InputMethod, data: InputData) {
self.inputs.insert(data, input);
}
}

View file

@ -1,175 +1,54 @@
use std::collections::{HashMap, HashSet};
mod color_cube;
use color_cube::ColorCube;
use manifest_dir_macros::directory_relative_path;
use mint::{Vector2, Vector3};
use stardust_xr_fusion::{
client::{Client, RootHandler}, core::values::ResourceID, data, drawable::Model, fields::BoxField, input::{InputData, InputDataType, InputHandler, InputHandlerHandler, UnknownInputMethod}, spatial::{SpatialAspect, Transform}, HandlerWrapper
client::{Client, FrameInfo, RootHandler},
input::InputHandler,
HandlerWrapper,
};
use stardust_xr_molecules::{input_action::{BaseInputAction, InputActionHandler}, Grabbable, GrabbableSettings, PointerMode};
#[derive(Debug, Clone, Copy)]
struct State {
size: Vector2<f32>,
}
struct Root {
model: Model,
field: BoxField,
grabbable: Grabbable,
input_handler: HandlerWrapper<InputHandler, InputActionHandler<State>>,
color_hover: BaseInputAction<State>,
pub hover_color: Vector3<f32>,
}
struct OtherStruct {
model: Model,
handler: InputHandler,
inputs: HashMap<InputData, UnknownInputMethod>,
}
impl OtherStruct {
fn update(&mut self, info: &stardust_xr_fusion::client::FrameInfo) {
for (data, method) in self.inputs.iter() {
data.datamap.with_data(|data| {
data.idx("color_hover").as_f32()
});
data.captured = true;
method.capture(&self.handler).unwrap();
}
self.inputs.clear();
}
}
impl InputHandlerHandler for OtherStruct {
fn input(&mut self, input: stardust_xr_fusion::input::UnknownInputMethod, data: InputData) {
self.inputs.insert(data);
}
}
impl Root {
async fn create(client: &Client) -> Self {
// stardust_xr_fusion::drawable::Model
// pub fn create(spatial_parent: &impl SpatialAspect, transform: Transform, model: &ResourceID) -> NodeResult<Self>
let model = Model::create(
client.get_root(),
Transform::identity(),
&ResourceID::new_namespaced(
"color_cube",
"color_cube"
),
).unwrap();
let field =
BoxField::create(&model, Transform::none(), [0.4; 3]).unwrap();
let grab_settings = GrabbableSettings {
zoneable: true,
..Default::default()
};
let grabbable =
Grabbable::create(client.get_root(), Transform::none(), &field, grab_settings).unwrap();
model
.set_spatial_parent_in_place(grabbable.content_parent())
.unwrap();
let input_handler = InputActionHandler::wrap(
InputHandler::create(
&model,
Transform::none(),
&field,
).unwrap(),
State { size: [0.1, 0.1].into() },
).unwrap();
let color_hover = BaseInputAction::new(
false,
Self::hover_action
);
let hover_color = [0.5; 3].into();
Root {
model,
field,
grabbable,
input_handler,
color_hover,
hover_color,
}
}
fn hover(size: Vector2<f32>, point: Vector3<f32>) -> bool {
point.x.abs() < size.x && point.y.abs() < size.y
}
fn hover_action(input: &InputData, state: &State) -> bool {
match &input.input {
InputDataType::Pointer(_) => input.distance < 0.0,
InputDataType::Hand(h) => {
Self::hover(state.size, h.index.tip.position)
}
InputDataType::Tip(t) => {
Self::hover(state.size, t.origin)
}
}
}
fn hover_point(&self, input: &InputData) -> Vector3<f32> {
let hover_point = match &input.input {
InputDataType::Pointer(p) => {
[0.0; 3].into()
}
InputDataType::Hand(h) => {
h.index.tip.position
}
InputDataType::Tip(t) => {
t.origin
}
};
return hover_point;
}
}
struct Root(HandlerWrapper<InputHandler, ColorCube>);
impl RootHandler for Root {
fn frame(&mut self, info: stardust_xr_fusion::client::FrameInfo) {
self.grabbable.update(&info).unwrap();
self.input_handler.lock_wrapped().update_actions([
&mut self.color_hover,
]);
fn frame(&mut self, info: FrameInfo) {
self.0.lock_wrapped().update(&info);
// self.grabbable.update(&info).unwrap();
// for input_data in self
// .color_hover
// .started
// self.input_handler.lock_wrapped().update_actions([
// &mut self.color_hover,
// ]);
if self.color_hover.currently_acting.is_empty() {
self.model.set_local_transform(
Transform::from_scale([1.1; 3])
).unwrap();
} else {
self.model.set_local_transform(
Transform::from_scale([1.0; 3])
).unwrap();
// for input_data in self
// .color_hover
// .started
// if self.color_hover.currently_acting.is_empty() {
// self.model.set_local_transform(
// Transform::from_scale([1.1; 3])
// ).unwrap();
// } else {
// self.model.set_local_transform(
// Transform::from_scale([1.0; 3])
// ).unwrap();
// }
}
}
fn save_state(&mut self) -> stardust_xr_fusion::client::ClientState {
todo!("implement save state")
}
fn save_state(&mut self) -> stardust_xr_fusion::client::ClientState {
todo!("implement save state")
}
}
#[tokio::main]
async fn main() {
let (client, event_loop) = Client::connect_with_async_loop().await.unwrap();
client.set_base_prefixes(&[directory_relative_path!("res")]);
let (client, event_loop) = Client::connect_with_async_loop().await.unwrap();
client.set_base_prefixes(&[directory_relative_path!("res")]);
let _root = client.wrap_root(Root::create(&client).await).unwrap();
let _root = client
.wrap_root(Root(ColorCube::create(&client).await))
.unwrap();
tokio::select! {
_ = tokio::signal::ctrl_c() => (),
_ = event_loop => panic!("server crashed"),
}
tokio::select! {
_ = tokio::signal::ctrl_c() => (),
_ = event_loop => panic!("server crashed"),
}
}