This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SOME: [char;10] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; | |
#[derive(Debug)] | |
struct Response { | |
last: usize, | |
limit: usize, | |
payload: Vec<char> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cell::RefCell; | |
enum Type { | |
Add, | |
Sub | |
} | |
struct Entity { | |
t: Type, | |
i: i32, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(PartialEq)] | |
enum Methods { | |
ALL, | |
GET, | |
HEAD, | |
POST, | |
PUT, | |
DELETE, | |
CONNECT, | |
OPTIONS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==== 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug)] | |
struct Entity { | |
x: u16, | |
y: u16, | |
} | |
impl Entity { | |
fn update(&mut self) -> Option<Entity> { | |
if self.x == u16::MAX { | |
self.x = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Point { | |
x: isize, | |
y: isize, | |
} | |
struct Circle { | |
center: Point, | |
radius: f64, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Point { | |
x: isize, | |
y: isize, | |
} | |
struct Circle { | |
center: Point, | |
radius: f64, | |
} |
NewerOlder