pub struct BlockStorage { /* private fields */ }Implementations§
Source§impl BlockStorage
impl BlockStorage
pub const DEFAULT_BLOB_CHUNK_SIZE: NonZeroU32
pub async fn new( db: CoreDb, config: BlockStorageConfig, block_handle_storage: Arc<BlockHandleStorage>, block_connection_storage: Arc<BlockConnectionStorage>, ) -> Result<Self>
pub fn open_stats(&self) -> &OpenStats
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 fn blocking_load_block_data( &self, handle: &BlockHandle, ) -> Result<BlockStuff>
pub async fn load_block_data_decompressed( &self, handle: &BlockHandle, ) -> Result<Bytes>
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_range( &self, handle: &BlockHandle, offset: u64, length: u64, ) -> Result<Option<Bytes>>
pub fn get_compressed_block_data_size( &self, handle: &BlockHandle, ) -> Result<Option<u64>>
pub async 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<Bytes>
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<Bytes>
pub async fn move_into_archive( &self, handle: &BlockHandle, mc_is_key_block: bool, ) -> Result<()>
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>>
pub fn get_archive_reader(&self, id: u32) -> Result<Option<BufReader<File>>>
Sourcepub async fn get_archive_chunk(&self, id: u32, offset: u64) -> Result<Bytes>
pub async fn get_archive_chunk(&self, id: u32, offset: u64) -> Result<Bytes>
Get a chunk of the archive at the specified offset.
pub fn subscribe_to_archive_ids(&self) -> Receiver<u32>
pub async fn remove_outdated_archives(&self, until_id: u32) -> Result<()>
pub fn estimate_archive_id(&self, mc_seqno: u32) -> u32
pub async fn remove_outdated_blocks( &self, mc_seqno: u32, max_blocks_per_batch: Option<usize>, ) -> 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 UnsafeUnpin 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