pub struct BlockStorage { /* private fields */ }Implementations§
Source§impl BlockStorage
impl BlockStorage
pub fn new( db: CoreDb, config: BlockStorageConfig, block_handle_storage: Arc<BlockHandleStorage>, block_connection_storage: Arc<BlockConnectionStorage>, archive_chunk_size: ByteSize, ) -> Self
pub fn archive_chunk_size(&self) -> NonZeroU32
pub fn block_data_chunk_size(&self) -> NonZeroU32
pub async fn finish_block_data(&self) -> Result<()>
Sourcepub async fn preload_archive_ids(&self) -> Result<()>
pub async fn preload_archive_ids(&self) -> Result<()>
Iterates over all archives and preloads their ids into memory.
pub async fn wait_for_block(&self, block_id: &BlockId) -> Result<BlockStuffAug>
pub async fn wait_for_next_block( &self, prev_block_id: &BlockId, ) -> Result<BlockStuffAug>
pub async fn store_block_data( &self, block: &BlockStuff, archive_data: &ArchiveData, meta_data: NewBlockMeta, ) -> Result<StoreBlockResult>
pub async fn load_block_data(&self, handle: &BlockHandle) -> Result<BlockStuff>
pub async fn load_block_data_raw( &self, handle: &BlockHandle, ) -> Result<OwnedPinnableSlice>
pub async fn list_blocks( &self, continuation: Option<BlockIdShort>, ) -> Result<(Vec<BlockId>, Option<BlockIdShort>)>
pub fn list_archive_ids(&self) -> Vec<u32>
pub async fn load_block_data_raw_ref<'a>( &'a self, handle: &'a BlockHandle, ) -> Result<impl AsRef<[u8]> + 'a>
pub fn find_mc_block_data(&self, mc_seqno: u32) -> Result<Option<Block>>
pub async fn store_block_proof( &self, proof: &BlockProofStuffAug, handle: MaybeExistingHandle, ) -> Result<StoreBlockResult>
pub async fn load_block_proof( &self, handle: &BlockHandle, ) -> Result<BlockProofStuff>
pub async fn load_block_proof_raw( &self, handle: &BlockHandle, ) -> Result<OwnedPinnableSlice>
pub async fn load_block_proof_raw_ref<'a>( &'a self, handle: &'a BlockHandle, ) -> Result<impl AsRef<[u8]> + 'a>
pub async fn store_queue_diff( &self, queue_diff: &QueueDiffStuffAug, handle: MaybeExistingHandle, ) -> Result<StoreBlockResult>
pub async fn load_queue_diff( &self, handle: &BlockHandle, ) -> Result<QueueDiffStuff>
pub async fn load_queue_diff_raw( &self, handle: &BlockHandle, ) -> Result<OwnedPinnableSlice>
pub async fn load_queue_diff_raw_ref<'a>( &'a self, handle: &'a BlockHandle, ) -> Result<impl AsRef<[u8]> + 'a>
Sourcepub async fn move_into_archive(
&self,
handle: &BlockHandle,
mc_is_key_block: bool,
) -> Result<()>
pub async fn move_into_archive( &self, handle: &BlockHandle, mc_is_key_block: bool, ) -> Result<()>
Loads data and proof for the block and appends them to the corresponding archive.
pub async fn wait_for_archive_commit(&self) -> Result<()>
Sourcepub fn get_archive_id(&self, mc_seqno: u32) -> ArchiveId
pub fn get_archive_id(&self, mc_seqno: u32) -> ArchiveId
Returns a corresponding archive id for the specified masterchain seqno.
pub fn get_archive_size(&self, id: u32) -> Result<Option<usize>>
Sourcepub async fn get_archive_chunk(
&self,
id: u32,
offset: u64,
) -> Result<OwnedPinnableSlice>
pub async fn get_archive_chunk( &self, id: u32, offset: u64, ) -> Result<OwnedPinnableSlice>
Loads an archive chunk.
pub fn get_block_data_size(&self, block_id: &BlockId) -> Result<Option<u32>>
pub fn get_block_data_chunk( &self, block_id: &BlockId, offset: u32, ) -> Result<Option<OwnedPinnableSlice>>
pub fn subscribe_to_archive_ids(&self) -> Receiver<u32>
pub fn archive_chunks_iterator(&self, archive_id: u32) -> DBRawIterator<'_>
pub async fn remove_outdated_blocks( &self, mc_seqno: u32, max_blocks_per_batch: Option<usize>, ) -> Result<()>
pub fn remove_outdated_archives(&self, until_id: u32) -> Result<()>
Auto Trait Implementations§
impl !Freeze for BlockStorage
impl !RefUnwindSafe for BlockStorage
impl Send for BlockStorage
impl Sync for BlockStorage
impl Unpin for BlockStorage
impl !UnwindSafe for BlockStorage
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more