pub struct Writer<'a> { /* private fields */ }Expand description
ASN.1 DER Writer to a mutable buffer
Implementations§
Source§impl<'a> Writer<'a>
impl<'a> Writer<'a>
Sourcepub fn new(buf: &'a mut [u8]) -> Self
pub fn new(buf: &'a mut [u8]) -> Self
create a new DER writer, with the buffer as the user allocated write buffer
Sourcepub fn integer<'b>(&mut self, integer: &'b Integer) -> Result<(), Error>
pub fn integer<'b>(&mut self, integer: &'b Integer) -> Result<(), Error>
Write an Integer to the DER writer
Sourcepub fn enumerated<'b>(
&mut self,
enumerated: &'b Enumerated,
) -> Result<(), Error>
pub fn enumerated<'b>( &mut self, enumerated: &'b Enumerated, ) -> Result<(), Error>
Write an Enumerated to the DER writer
Sourcepub fn bitstring<'b>(&mut self, obj: &'b BitString) -> Result<(), Error>
pub fn bitstring<'b>(&mut self, obj: &'b BitString) -> Result<(), Error>
Write a bitstring to the DER writer
Sourcepub fn octetstring<'b>(&mut self, obj: &'b [u8]) -> Result<(), Error>
pub fn octetstring<'b>(&mut self, obj: &'b [u8]) -> Result<(), Error>
Write a octetstring to the DER writer
Sourcepub fn utf8_string<'b>(&mut self, str: &'b str) -> Result<(), Error>
pub fn utf8_string<'b>(&mut self, str: &'b str) -> Result<(), Error>
Write a utf8 string to the DER writer
Sourcepub fn current_position(&self) -> usize
pub fn current_position(&self) -> usize
Get the current position in the Writer, which is also the number of byte written
Auto Trait Implementations§
impl<'a> Freeze for Writer<'a>
impl<'a> RefUnwindSafe for Writer<'a>
impl<'a> Send for Writer<'a>
impl<'a> Sync for Writer<'a>
impl<'a> Unpin for Writer<'a>
impl<'a> !UnwindSafe for Writer<'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