bomputer: init

This commit is contained in:
nym21
2025-01-31 11:43:14 +01:00
parent 8c610f8a83
commit ad34d9d402
67 changed files with 498 additions and 249 deletions
@@ -0,0 +1,21 @@
use bindex::{Addressindex, Txoutindex};
use fjall::Slice;
use unsafe_slice_serde::UnsafeSliceSerde;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct AddressindexTxoutindex {
addressindex: Addressindex,
txoutindex: Txoutindex,
}
impl TryFrom<Slice> for AddressindexTxoutindex {
type Error = unsafe_slice_serde::Error;
fn try_from(value: Slice) -> Result<Self, Self::Error> {
Ok(*Self::unsafe_try_from_slice(&value)?)
}
}
impl From<AddressindexTxoutindex> for Slice {
fn from(value: AddressindexTxoutindex) -> Self {
Self::new(value.unsafe_as_slice())
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ use color_eyre::eyre::eyre;
use derive_deref::Deref;
use jiff::{civil::Date as _Date, tz::TimeZone};
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Deref)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Deref)]
pub struct Date(_Date);
impl Date {
+4
View File
@@ -1,5 +1,9 @@
mod addressindextxoutindex;
mod date;
mod feerate;
mod unit;
pub use addressindextxoutindex::*;
pub use date::*;
pub use feerate::*;
pub use unit::*;
+13
View File
@@ -0,0 +1,13 @@
use fjall::Slice;
pub struct Unit();
impl From<Slice> for Unit {
fn from(_: Slice) -> Self {
Self()
}
}
impl From<Unit> for Slice {
fn from(_: Unit) -> Self {
Self::new(&[])
}
}