5 releases

new 0.1.14 Jan 23, 2025
0.1.13 Jan 22, 2025
0.1.12 Jan 22, 2025
0.1.11 Jan 22, 2025
0.1.10 Jan 22, 2025

#415 in Internationalization (i18n)

Download history 411/week @ 2025-01-18

411 downloads per month
Used in xkv

MulanPSL-2.0

24KB
111 lines

static_

use aok::{Result, OK};
use tokio::time::{sleep, Duration};
use tracing::info;

pub struct Client {}

impl Client {
  pub async fn test(&self) {
    info!("client test success");
  }
}

pub async fn connect() -> Result<Client> {
  info!("Sleeping for 3 seconds...");
  sleep(Duration::from_secs(3)).await;
  Ok(Client {})
}

static_::init!(CLIENT: Client {
  connect().await
});

#[tokio::main]
async fn main() -> Result<()> {
  static_::init().await?;
  info!("inited");
  CLIENT.test().await;
  OK
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~2.8–9MB
~74K SLoC