pub struct Blob { /* private fields */ }
Expand description
A blob.
A PBF file consists of a sequence of blobs. This type supports decoding the content of a blob to different types of blocks that are usually more interesting to the user.
Implementations§
source§impl Blob
impl Blob
sourcepub fn decode(&self) -> Result<BlobDecode<'_>>
pub fn decode(&self) -> Result<BlobDecode<'_>>
Decodes the Blob and tries to obtain the inner content (usually a HeaderBlock
or a
PrimitiveBlock
). This operation might involve an expensive decompression step.
sourcepub fn get_type(&self) -> BlobType<'_>
pub fn get_type(&self) -> BlobType<'_>
Returns the type of a blob without decoding its content.
sourcepub fn offset(&self) -> Option<ByteOffset>
pub fn offset(&self) -> Option<ByteOffset>
sourcepub fn to_headerblock(&self) -> Result<HeaderBlock>
pub fn to_headerblock(&self) -> Result<HeaderBlock>
Tries to decode the blob to a HeaderBlock
. This operation might involve an expensive
decompression step.
sourcepub fn to_primitiveblock(&self) -> Result<PrimitiveBlock>
pub fn to_primitiveblock(&self) -> Result<PrimitiveBlock>
Tries to decode the blob to a PrimitiveBlock
. This operation might involve an expensive
decompression step.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Blob
impl Send for Blob
impl Sync for Blob
impl Unpin for Blob
impl UnwindSafe for Blob
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