livesplit-core 0.13.0

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod time;
pub use self::time::*;

pub struct RwLock<T>(core::cell::RefCell<T>);

impl<T> RwLock<T> {
    pub fn new(value: T) -> Self {
        Self(core::cell::RefCell::new(value))
    }

    pub fn write(&self) -> Result<core::cell::RefMut<'_, T>, ()> {
        Ok(self.0.borrow_mut())
    }

    pub fn read(&self) -> Result<core::cell::Ref<'_, T>, ()> {
        Ok(self.0.borrow())
    }
}