[][src]Struct basn1::der::writer::Writer

pub struct Writer<'a> { /* fields omitted */ }

ASN.1 DER Writer to a mutable buffer

Implementations

impl<'a> Writer<'a>[src]

pub fn new(buf: &'a mut [u8]) -> Self[src]

create a new DER writer, with the buffer as the user allocated write buffer

pub fn bool(&mut self, b: bool) -> Result<(), Error>[src]

Write a boolean to the DER writer

pub fn integer<'b>(&mut self, integer: &'b Integer) -> Result<(), Error>[src]

Write an Integer to the DER writer

pub fn enumerated<'b>(
    &mut self,
    enumerated: &'b Enumerated
) -> Result<(), Error>
[src]

Write an Enumerated to the DER writer

pub fn bitstring<'b>(&mut self, obj: &'b BitString) -> Result<(), Error>[src]

Write a bitstring to the DER writer

pub fn octetstring<'b>(&mut self, obj: &'b [u8]) -> Result<(), Error>[src]

Write a octetstring to the DER writer

pub fn null(&mut self) -> Result<(), Error>[src]

Write a null to the DER writer

pub fn utf8_string<'b>(&mut self, str: &'b str) -> Result<(), Error>[src]

Write a utf8 string to the DER writer

pub fn sequence<'b, F>(&mut self, f: F) -> Result<(), Error> where
    F: Fn(&mut Self) -> Result<(), Error>, 
[src]

Write a sequence to the DER writer

pub fn current_position(&self) -> usize[src]

Get the current position in the Writer, which is also the number of byte written

pub fn finish<'b: 'a>(&'b self) -> &'a [u8][src]

Return the inner sub-slice with a valid DER stream of data

Auto Trait Implementations

impl<'a> Send for Writer<'a>

impl<'a> Sync for Writer<'a>

impl<'a> Unpin for Writer<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.