pub struct Decoder<'a> { /* private fields */ }Expand description
Binary TLV decoder.
Implementations§
Source§impl<'a> Decoder<'a>
impl<'a> Decoder<'a>
Sourcepub fn u64(&mut self) -> Result<u64, BinaryCodecError>
pub fn u64(&mut self) -> Result<u64, BinaryCodecError>
Sourcepub fn bytes(&mut self) -> Result<&'a [u8], BinaryCodecError>
pub fn bytes(&mut self) -> Result<&'a [u8], BinaryCodecError>
Decodes tagged bytes.
§Errors
BinaryCodecError::Tagif tag mismatchBinaryCodecError::SizeLimitif length exceedsMAX_BYTES_LENBinaryCodecError::Eofif insufficient data
Sourcepub fn str(&mut self) -> Result<&'a str, BinaryCodecError>
pub fn str(&mut self) -> Result<&'a str, BinaryCodecError>
Decodes a tagged UTF-8 string.
§Errors
BinaryCodecError::Tagif tag mismatchBinaryCodecError::SizeLimitif length exceedsMAX_BYTES_LENBinaryCodecError::Eofif insufficient dataBinaryCodecError::Utf8if invalid UTF-8
Sourcepub fn cid32(&mut self) -> Result<Cid32, BinaryCodecError>
pub fn cid32(&mut self) -> Result<Cid32, BinaryCodecError>
Sourcepub fn public_key(&mut self) -> Result<PublicKeyBytes, BinaryCodecError>
pub fn public_key(&mut self) -> Result<PublicKeyBytes, BinaryCodecError>
Sourcepub fn signature(&mut self) -> Result<SignatureBytes, BinaryCodecError>
pub fn signature(&mut self) -> Result<SignatureBytes, BinaryCodecError>
Auto Trait Implementations§
impl<'a> Freeze for Decoder<'a>
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> Send for Decoder<'a>
impl<'a> Sync for Decoder<'a>
impl<'a> Unpin for Decoder<'a>
impl<'a> UnwindSafe for Decoder<'a>
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