squire 0.0.1-alpha.1

Safe and idiomatic SQLite bindings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use core::num::NonZero;

#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)]
#[repr(transparent)]
pub struct RowId(NonZero<i64>);

impl RowId {
    pub const fn new(value: i64) -> Option<Self> {
        match NonZero::new(value) {
            Some(id) => Some(RowId(id)),
            None => None,
        }
    }

    pub const fn into_inner(self) -> i64 {
        self.0.get()
    }
}