pub struct BlockDir { /* private fields */ }Expand description
A readable, writable directory within a band holding data blocks.
Implementations§
source§impl BlockDir
impl BlockDir
pub fn open_path(path: &Path) -> BlockDir
pub fn open(transport: Box<dyn Transport>) -> BlockDir
sourcepub fn create_path(path: &Path) -> Result<BlockDir>
pub fn create_path(path: &Path) -> Result<BlockDir>
Create a BlockDir directory and return an object accessing it.
pub fn create(transport: Box<dyn Transport>) -> Result<BlockDir>
sourcepub fn contains(&self, hash: &BlockHash) -> Result<bool>
pub fn contains(&self, hash: &BlockHash) -> Result<bool>
True if the named block is present in this directory.
sourcepub fn compressed_size(&self, hash: &BlockHash) -> Result<u64>
pub fn compressed_size(&self, hash: &BlockHash) -> Result<u64>
Returns the compressed on-disk size of a block.
sourcepub fn get(&self, address: &Address) -> Result<(Vec<u8>, Sizes)>
pub fn get(&self, address: &Address) -> Result<(Vec<u8>, Sizes)>
Read back the contents of a block, as a byte array.
To read a whole file, use StoredFile instead.
pub fn delete_block(&self, hash: &BlockHash) -> Result<()>
sourcepub fn block_names(&self) -> Result<impl Iterator<Item = BlockHash>>
pub fn block_names(&self) -> Result<impl Iterator<Item = BlockHash>>
Return all the blocknames in the blockdir, in arbitrary order.
sourcepub fn block_names_set(&self) -> Result<HashSet<BlockHash>>
pub fn block_names_set(&self) -> Result<HashSet<BlockHash>>
Return all the blocknames in the blockdir, while showing progress.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BlockDir
impl Send for BlockDir
impl Sync for BlockDir
impl Unpin for BlockDir
impl !UnwindSafe for BlockDir
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