gdrust-trinkets 0.1.1

A collection of useful controls, traits, and macros for godot x rust development.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::Mutex;

pub trait Identifiable {
    fn id(&self) -> i64;
}

static CID: Mutex<i64> = Mutex::new(0);

pub fn uuid() -> i64 {
    let mut id = CID.lock().unwrap();
    *id += 1;
    *id - 1
}