pub struct ByteSeq<'a> { /* private fields */ }Expand description
A Byte Sequence: the base64 text between the colons.
§Examples
use parse_net::sfv::{self, BareItem};
let BareItem::ByteSeq(b) = sfv::parse_item(b":aGVsbG8=:")?.bare else { unreachable!() };
assert_eq!(b.decoded_len(), 5);Implementations§
Source§impl<'a> ByteSeq<'a>
impl<'a> ByteSeq<'a>
Sourcepub const fn raw(&self) -> &'a [u8] ⓘ
pub const fn raw(&self) -> &'a [u8] ⓘ
The base64 text, padding included if it was sent.
§Examples
use parse_net::sfv::{self, BareItem};
let BareItem::ByteSeq(b) = sfv::parse_item(b":aGVsbG8=:")?.bare else { unreachable!() };
assert_eq!(b.raw(), b"aGVsbG8=");Sourcepub fn decoded_len(&self) -> usize
pub fn decoded_len(&self) -> usize
The exact length of the decoded bytes.
§Examples
use parse_net::sfv::{self, BareItem};
let BareItem::ByteSeq(b) = sfv::parse_item(b":cHJldGVuZCB0aGlzIGlzIGJpbmFyeSBjb250ZW50Lg==:")?.bare else { unreachable!() };
assert_eq!(b.decoded_len(), 31);Trait Implementations§
impl<'a> Copy for ByteSeq<'a>
impl<'a> Eq for ByteSeq<'a>
impl<'a> StructuralPartialEq for ByteSeq<'a>
Auto Trait Implementations§
impl<'a> Forget for ByteSeq<'a>
impl<'a> Freeze for ByteSeq<'a>
impl<'a> RefUnwindSafe for ByteSeq<'a>
impl<'a> Send for ByteSeq<'a>
impl<'a> Sync for ByteSeq<'a>
impl<'a> Unpin for ByteSeq<'a>
impl<'a> UnsafeUnpin for ByteSeq<'a>
impl<'a> UnwindSafe for ByteSeq<'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