pub struct BitString<'a> { /* private fields */ }
Expand description
Represents an ASN.1 BIT STRING
whose contents is borrowed.
Implementations§
source§impl<'a> BitString<'a>
impl<'a> BitString<'a>
pub fn new(data: &'a [u8], padding_bits: u8) -> Option<BitString<'a>>
sourcepub fn as_bytes(&self) -> &'a [u8] ⓘ
pub fn as_bytes(&self) -> &'a [u8] ⓘ
Returns a sequence of bytes representing the data in the BIT STRING
. Padding bits will
always be 0.
sourcepub fn padding_bits(&self) -> u8
pub fn padding_bits(&self) -> u8
Returns the number of padding bits. Will always be in [0, 8).
sourcepub fn has_bit_set(&self, n: usize) -> bool
pub fn has_bit_set(&self, n: usize) -> bool
Returns whether the requested bit is set. Padding bits will always return false and asking for bits that exceed the length of the bit string will also return false.
Trait Implementations§
source§impl<'a> PartialEq for BitString<'a>
impl<'a> PartialEq for BitString<'a>
source§impl<'a> SimpleAsn1Readable<'a> for BitString<'a>
impl<'a> SimpleAsn1Readable<'a> for BitString<'a>
const TAG: Tag = _
fn parse_data(data: &'a [u8]) -> ParseResult<BitString<'a>>
source§impl<'a> SimpleAsn1Writable for BitString<'a>
impl<'a> SimpleAsn1Writable for BitString<'a>
const TAG: Tag = _
fn write_data(&self, dest: &mut WriteBuf) -> WriteResult
impl<'a> Eq for BitString<'a>
impl<'a> StructuralPartialEq for BitString<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for BitString<'a>
impl<'a> Send for BitString<'a>
impl<'a> Sync for BitString<'a>
impl<'a> Unpin for BitString<'a>
impl<'a> UnwindSafe for BitString<'a>
Blanket Implementations§
source§impl<'a, T> Asn1Readable<'a> for Twhere
T: SimpleAsn1Readable<'a>,
impl<'a, T> Asn1Readable<'a> for Twhere
T: SimpleAsn1Readable<'a>,
source§impl<T> Asn1Writable for Twhere
T: SimpleAsn1Writable,
impl<T> Asn1Writable for Twhere
T: SimpleAsn1Writable,
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