use std::sync::{Arc, Mutex};
use std::thread;
fn main() {
let counter = Arc::new(Mutex::new(0));
let mut handles = vec![];
#[derive(Default, Debug)]
struct Config {
host: String,
port: u16,
debug: bool,
}
[features]
default = ["json"]
json = ["serde_json"]
yaml = ["serde_yaml"]
[dependencies]
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
struct Config {
host: String,
port: u16,
fn divide(a: i32, b: i32) -> i32 {
if b == 0 {
panic!("division by zero");
}
a / b
}
use nom::{
bytes::complete::tag,
character::complete::digit1,
IResult,
};
use sqlx::PgPool;
#[derive(sqlx::FromRow)]
struct User {
id: i32,
name: String,
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct UserId(u32);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct PostId(u32);
use tokio::time::{sleep, Duration};
#[tokio::main]
async fn main() {
let handle = tokio::spawn(async {
sleep(Duration::from_millis(100)).await;
#[cfg(target_os = "linux")]
fn platform_specific() {
println!("Running on Linux");
}
#[cfg(target_os = "windows")]
#[derive(Debug, Clone, PartialEq)]
struct Point {
x: i32,
y: i32,
}
[workspace]
members = [
"server",
"client",
"common",
]