pub struct BerWriter<'a> { /* private fields */ }Expand description
A BER writer that encodes TLV elements into a byte slice.
Implementations§
Source§impl<'a> BerWriter<'a>
impl<'a> BerWriter<'a>
Sourcepub fn write_integer(&mut self, value: i64) -> Result<(), SleError>
pub fn write_integer(&mut self, value: i64) -> Result<(), SleError>
Writes an ASN.1 INTEGER (signed, variable length).
Sourcepub fn write_octet_string(&mut self, data: &[u8]) -> Result<(), SleError>
pub fn write_octet_string(&mut self, data: &[u8]) -> Result<(), SleError>
Writes an ASN.1 OCTET STRING.
Sourcepub fn write_enum(&mut self, value: i64) -> Result<(), SleError>
pub fn write_enum(&mut self, value: i64) -> Result<(), SleError>
Writes an ASN.1 ENUMERATED value.
Sourcepub fn write_null(&mut self) -> Result<(), SleError>
pub fn write_null(&mut self) -> Result<(), SleError>
Writes an ASN.1 NULL.
Sourcepub fn write_bit_string(&mut self, data: &[u8]) -> Result<(), SleError>
pub fn write_bit_string(&mut self, data: &[u8]) -> Result<(), SleError>
Writes an ASN.1 BIT STRING with zero unused bits.
Sourcepub fn begin_sequence(&mut self) -> Result<SeqStart, SleError>
pub fn begin_sequence(&mut self) -> Result<SeqStart, SleError>
Begins a SEQUENCE. Returns the position of the length field
so it can be patched later with end_sequence.
Auto Trait Implementations§
impl<'a> Freeze for BerWriter<'a>
impl<'a> RefUnwindSafe for BerWriter<'a>
impl<'a> Send for BerWriter<'a>
impl<'a> Sync for BerWriter<'a>
impl<'a> Unpin for BerWriter<'a>
impl<'a> UnsafeUnpin for BerWriter<'a>
impl<'a> !UnwindSafe for BerWriter<'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