use std::mem;
fn main() {
let mut x = 5;
let mut y = 10;
use std::error::Error;
use std::fmt;
use std::io;
use std::num::ParseIntError;
#[derive(Debug)]
use crate::paginator::Paginator;
#[derive(Clone)]
pub struct Row {
pub cells: Vec<String>,
}
use std::rc::Rc;
use std::cell::RefCell;
fn main() {
let data = Rc::new(RefCell::new(vec![1, 2, 3]));
struct Logger {
name: String,
}
impl Drop for Logger {
fn drop(&mut self) {
[package]
name = "my-app"
version = "0.1.0"
[dependencies]
tokio = "1"
use dashmap::DashMap;
use std::time::Instant;
pub struct TokenBucket {
tokens: f64,
last_refill: Instant,
struct Locked;
struct Unlocked;
struct Door<State> {
_state: std::marker::PhantomData<State>,
}
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize)]
pub struct SignupRequest {
pub email: String,
pub password: String,
use tokio::time::{sleep, Duration};
async fn fetch_data() -> String {
sleep(Duration::from_millis(100)).await;
"data".to_string()
}
// In a proc-macro crate:
use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};
#[proc_macro_derive(MyTrait)]
#![feature(asm)]
fn add_asm(a: u64, b: u64) -> u64 {
let result: u64;
unsafe {
asm!(