Struct btlib::BlockStream
source · pub struct BlockStream<T, C> { /* private fields */ }
Expand description
A stream which is responsible for managing the metadata associated with a block, including validating and authenticating it. This type shouldn’t be instantiated direction, instead a BlockOpenOptions struct is used.
Trait Implementations§
source§impl<T, C> AsMut<BlockMeta> for BlockStream<T, C>
impl<T, C> AsMut<BlockMeta> for BlockStream<T, C>
source§impl<T, C> AsRef<BlockMeta> for BlockStream<T, C>
impl<T, C> AsRef<BlockMeta> for BlockStream<T, C>
source§impl<T, C> Decompose<(T, C)> for BlockStream<T, C>
impl<T, C> Decompose<(T, C)> for BlockStream<T, C>
fn into_inner(self) -> (T, C)
source§impl<T: WriteAt + Size, C: Signer> FlushMeta for BlockStream<T, C>
impl<T: WriteAt + Size, C: Signer> FlushMeta for BlockStream<T, C>
source§fn flush_meta(&mut self) -> Result<()>
fn flush_meta(&mut self) -> Result<()>
Flushes metadata to persistent storage.
source§impl<T: ReadAt + Size, C> ReadAt for BlockStream<T, C>
impl<T: ReadAt + Size, C> ReadAt for BlockStream<T, C>
source§impl<T, C> Sectored for BlockStream<T, C>
impl<T, C> Sectored for BlockStream<T, C>
source§fn sector_sz64(&self) -> u64
fn sector_sz64(&self) -> u64
Returns the sector size as a
u64
.source§fn assert_sector_sz(&self, actual: usize) -> Result<()>
fn assert_sector_sz(&self, actual: usize) -> Result<()>
Returns
Err(Error::IncorrectSize)
if the given size is not equal to the sector size.source§impl<T: Size, C> Size for BlockStream<T, C>
impl<T: Size, C> Size for BlockStream<T, C>
source§impl<T: WriteAt + Size, C: Signer + Principaled + Decrypter> WriteAt for BlockStream<T, C>
impl<T: WriteAt + Size, C: Signer + Principaled + Decrypter> WriteAt for BlockStream<T, C>
source§impl<T: WriteAt + Size, C: Signer + Principaled + Decrypter> WriteInteg for BlockStream<T, C>
impl<T: WriteAt + Size, C: Signer + Principaled + Decrypter> WriteInteg for BlockStream<T, C>
Auto Trait Implementations§
impl<T, C> RefUnwindSafe for BlockStream<T, C>where C: RefUnwindSafe, T: RefUnwindSafe,
impl<T, C> Send for BlockStream<T, C>where C: Send, T: Send,
impl<T, C> Sync for BlockStream<T, C>where C: Sync, T: Sync,
impl<T, C> Unpin for BlockStream<T, C>where C: Unpin, T: Unpin,
impl<T, C> UnwindSafe for BlockStream<T, C>where C: UnwindSafe, T: UnwindSafe,
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
§impl<T> Free for T
impl<T> Free for T
source§impl<T> MetaAccess for Twhere
T: AsMut<BlockMeta> + MetaReader + ?Sized,
impl<T> MetaAccess for Twhere T: AsMut<BlockMeta> + MetaReader + ?Sized,
fn mut_meta(&mut self) -> &mut BlockMeta
fn mut_meta_body(&mut self) -> &mut BlockMetaBody
source§impl<R> ReadBytesAtExt for Rwhere
R: ReadAt,
impl<R> ReadBytesAtExt for Rwhere R: ReadAt,
source§fn read_u8_at(&self, pos: u64) -> Result<u8, Error>
fn read_u8_at(&self, pos: u64) -> Result<u8, Error>
Reads an unsigned 8-bit integer at an offset.
source§fn read_i8_at(&self, pos: u64) -> Result<i8, Error>
fn read_i8_at(&self, pos: u64) -> Result<i8, Error>
Reads a signed 8-bit integer at an offset.
source§fn read_u16_at<T>(&self, pos: u64) -> Result<u16, Error>where
T: ByteOrder,
fn read_u16_at<T>(&self, pos: u64) -> Result<u16, Error>where T: ByteOrder,
Reads an unsigned 16-bit integer at an offset.
source§fn read_i16_at<T>(&self, pos: u64) -> Result<i16, Error>where
T: ByteOrder,
fn read_i16_at<T>(&self, pos: u64) -> Result<i16, Error>where T: ByteOrder,
Reads a signed 16-bit integer at an offset.
source§fn read_u32_at<T>(&self, pos: u64) -> Result<u32, Error>where
T: ByteOrder,
fn read_u32_at<T>(&self, pos: u64) -> Result<u32, Error>where T: ByteOrder,
Reads an unsigned 32-bit integer at an offset.
source§fn read_i32_at<T>(&self, pos: u64) -> Result<i32, Error>where
T: ByteOrder,
fn read_i32_at<T>(&self, pos: u64) -> Result<i32, Error>where T: ByteOrder,
Reads a signed 32-bit integer at an offset.
source§fn read_u64_at<T>(&self, pos: u64) -> Result<u64, Error>where
T: ByteOrder,
fn read_u64_at<T>(&self, pos: u64) -> Result<u64, Error>where T: ByteOrder,
Reads an unsigned 64-bit integer at an offset.
source§fn read_i64_at<T>(&self, pos: u64) -> Result<i64, Error>where
T: ByteOrder,
fn read_i64_at<T>(&self, pos: u64) -> Result<i64, Error>where T: ByteOrder,
Reads a signed 64-bit integer at an offset.
source§fn read_uint_at<T>(&self, pos: u64, nbytes: usize) -> Result<u64, Error>where
T: ByteOrder,
fn read_uint_at<T>(&self, pos: u64, nbytes: usize) -> Result<u64, Error>where T: ByteOrder,
Reads an unsigned
nbytes
-bit integer at an offset.source§fn read_int_at<T>(&self, pos: u64, nbytes: usize) -> Result<i64, Error>where
T: ByteOrder,
fn read_int_at<T>(&self, pos: u64, nbytes: usize) -> Result<i64, Error>where T: ByteOrder,
Reads a signed
nbytes
-bit integer at an offset.source§impl<W> WriteBytesAtExt for Wwhere
W: WriteAt,
impl<W> WriteBytesAtExt for Wwhere W: WriteAt,
source§fn write_u8_at(&mut self, pos: u64, n: u8) -> Result<(), Error>
fn write_u8_at(&mut self, pos: u64, n: u8) -> Result<(), Error>
Writes an unsigned 8-bit integer to an offset.
source§fn write_i8_at(&mut self, pos: u64, n: i8) -> Result<(), Error>
fn write_i8_at(&mut self, pos: u64, n: i8) -> Result<(), Error>
Writes a signed 8-bit integer to an offset.
source§fn write_u16_at<T>(&mut self, pos: u64, n: u16) -> Result<(), Error>where
T: ByteOrder,
fn write_u16_at<T>(&mut self, pos: u64, n: u16) -> Result<(), Error>where T: ByteOrder,
Writes an unsigned 16-bit integer to an offset.
source§fn write_i16_at<T>(&mut self, pos: u64, n: i16) -> Result<(), Error>where
T: ByteOrder,
fn write_i16_at<T>(&mut self, pos: u64, n: i16) -> Result<(), Error>where T: ByteOrder,
Writes a signed 16-bit integer to an offset.
source§fn write_u32_at<T>(&mut self, pos: u64, n: u32) -> Result<(), Error>where
T: ByteOrder,
fn write_u32_at<T>(&mut self, pos: u64, n: u32) -> Result<(), Error>where T: ByteOrder,
Writes an unsigned 32-bit integer to an offset.
source§fn write_i32_at<T>(&mut self, pos: u64, n: i32) -> Result<(), Error>where
T: ByteOrder,
fn write_i32_at<T>(&mut self, pos: u64, n: i32) -> Result<(), Error>where T: ByteOrder,
Writes a signed 32-bit integer to an offset.
source§fn write_u64_at<T>(&mut self, pos: u64, n: u64) -> Result<(), Error>where
T: ByteOrder,
fn write_u64_at<T>(&mut self, pos: u64, n: u64) -> Result<(), Error>where T: ByteOrder,
Writes an unsigned 64-bit integer to an offset.
source§fn write_i64_at<T>(&mut self, pos: u64, n: i64) -> Result<(), Error>where
T: ByteOrder,
fn write_i64_at<T>(&mut self, pos: u64, n: i64) -> Result<(), Error>where T: ByteOrder,
Writes a signed 64-bit integer to an offset.
source§fn write_uint_at<T>(
&mut self,
pos: u64,
n: u64,
nbytes: usize
) -> Result<(), Error>where
T: ByteOrder,
fn write_uint_at<T>( &mut self, pos: u64, n: u64, nbytes: usize ) -> Result<(), Error>where T: ByteOrder,
Writes an unsigned
nbytes
-bit integer to an offset.source§fn write_int_at<T>(
&mut self,
pos: u64,
n: i64,
nbytes: usize
) -> Result<(), Error>where
T: ByteOrder,
fn write_int_at<T>( &mut self, pos: u64, n: i64, nbytes: usize ) -> Result<(), Error>where T: ByteOrder,
Writes a signed
nbytes
-bit integer to an offset.