Skip to content

Instantly share code, notes, and snippets.

use std::cell::RefCell;
enum Type {
Add,
Sub
}
struct Entity {
t: Type,
i: i32,
#[derive(PartialEq)]
#[repr(u16)]
enum Methods {
ALL = 0,
GET = 1 << 0,
HEAD = 1 << 1,
POST = 1 << 2,
PUT = 1 << 3,
DELETE = 1 << 4,
CONNECT = 1 << 5,
#[derive(PartialEq)]
enum Methods {
ALL,
GET,
HEAD,
POST,
PUT,
DELETE,
CONNECT,
OPTIONS,
// ==== CURRENT ====
// insert
mystore.insert(&key1, MSG2);
// insert async
let in_handle = mystore.insert_async(&key1, MSG2)?;
store.pending_insert_wait(in_handle);
// (in-review) buildable insert
store.build_insert(&key1, MSG1)
.mode(InsertMode::Add)
.time_to_live(std::time::Duration::from_secs(5))
#[derive(Debug)]
struct Entity {
x: u16,
y: u16,
}
impl Entity {
fn update(&mut self) -> Option<Entity> {
if self.x == u16::MAX {
self.x = 0;
use serde::{Serialize, Deserialize};
use serde::de::{Deserializer, SeqAccess, Visitor};
use std::fmt;
#[derive(Debug)]
struct BatchAction {}
#[derive(Serialize, Deserialize, Debug)]
struct KVItem<'a> {
key: &'a str,
#include <GLES2/gl2.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_error.h>
#include <SDL2/SDL_events.h>
#include <SDL2/SDL_opengles2.h>
#include <SDL2/SDL_render.h>
#define WINDOW_W 320
#define WINDOW_H 180
struct Point {
x: isize,
y: isize,
}
struct Circle {
center: Point,
radius: f64,
}
struct Point {
x: isize,
y: isize,
}
struct Circle {
center: Point,
radius: f64,
}
// The standard library imports.
use std::sync::mpsc::channel;
use std::thread::spawn;
use std::sync::Mutex;
use rouille;
fn main() {
println!("Hello, world!");