mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-13 08:23:32 -07:00
bomputer: init
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
mod addressindextxoutindex;
|
||||
mod date;
|
||||
mod feerate;
|
||||
mod unit;
|
||||
|
||||
pub use addressindextxoutindex::*;
|
||||
pub use date::*;
|
||||
pub use feerate::*;
|
||||
pub use unit::*;
|
||||
|
||||
@@ -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(&[])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user