pub struct Storage {
pub io_interface: Box<dyn InterfaceIO + Send + Sync>,
}
Fields§
§io_interface: Box<dyn InterfaceIO + Send + Sync>
Implementations§
Source§impl Storage
impl Storage
pub fn new(io_interface: Box<dyn InterfaceIO + Send + Sync>) -> Storage
pub async fn write(&mut self, data: &[u8], filename: &str)
pub async fn file_exists(&self, filename: &str) -> bool
pub fn generate_block_filepath(&self, block: &Block) -> String
pub async fn write_block_to_disk(&mut self, block: &Block) -> String
pub async fn load_block_name_list(&self) -> Result<Vec<String>, Error>
pub async fn load_blocks_from_disk( &mut self, file_names: &[String], mempool_lock: Arc<RwLock<Mempool>>, )
pub async fn load_block_from_disk( &self, file_name: &str, ) -> Result<Block, Error>
pub async fn delete_block_from_disk(&self, filename: &str) -> bool
Sourcepub async fn get_token_supply_slips_from_disk_path(
&self,
issuance_file: &str,
) -> Vec<Slip>
pub async fn get_token_supply_slips_from_disk_path( &self, issuance_file: &str, ) -> Vec<Slip>
Asynchronously retrieves token issuance slips from the provided file path.
This function reads a file from disk that contains the token issuance slips and returns these slips as a vector.
Sourcepub async fn get_token_supply_slips_from_disk(&self) -> Vec<Slip>
pub async fn get_token_supply_slips_from_disk(&self) -> Vec<Slip>
get issuance slips from the standard file
pub fn decode_str(string: &str) -> Result<Vec<u8>, Error>
Sourcepub async fn write_utxoset_to_disk_path(
&self,
balance_map: AHashMap<SaitoPublicKey, u64>,
threshold: u64,
path: &str,
) -> Result<(), Box<dyn Error>>
pub async fn write_utxoset_to_disk_path( &self, balance_map: AHashMap<SaitoPublicKey, u64>, threshold: u64, path: &str, ) -> Result<(), Box<dyn Error>>
store the state of utxo balances given that map of balances and a treshold
Sourcepub async fn write_utxoset_to_disk(
&self,
balance_map: AHashMap<SaitoPublicKey, u64>,
threshold: u64,
)
pub async fn write_utxoset_to_disk( &self, balance_map: AHashMap<SaitoPublicKey, u64>, threshold: u64, )
store the state of utxo balances to standard file
pub async fn load_checkpoint_file( &self, block_hash: &SaitoHash, block_id: BlockId, ) -> Option<Vec<SaitoUTXOSetKey>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl !RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl !UnwindSafe for Storage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more