pub struct Writer<'a> { /* private fields */ }
Expand description
Encapsulates an ongoing write. For almost all use-cases the correct
entrypoint is write()
or write_single()
.
Implementations§
source§impl Writer<'_>
impl Writer<'_>
sourcepub fn write_element<T: Asn1Writable>(&mut self, val: &T) -> WriteResult
pub fn write_element<T: Asn1Writable>(&mut self, val: &T) -> WriteResult
Writes a single element to the output.
sourcepub fn write_explicit_element<T: Asn1Writable>(
&mut self,
val: &T,
tag: u32
) -> WriteResult
pub fn write_explicit_element<T: Asn1Writable>( &mut self, val: &T, tag: u32 ) -> WriteResult
This is an alias for write_element::<Explicit<T, tag>>
.
sourcepub fn write_optional_explicit_element<T: Asn1Writable>(
&mut self,
val: &Option<T>,
tag: u32
) -> WriteResult
pub fn write_optional_explicit_element<T: Asn1Writable>( &mut self, val: &Option<T>, tag: u32 ) -> WriteResult
This is an alias for write_element::<Option<Explicit<T, tag>>>
.
sourcepub fn write_implicit_element<T: SimpleAsn1Writable>(
&mut self,
val: &T,
tag: u32
) -> WriteResult
pub fn write_implicit_element<T: SimpleAsn1Writable>( &mut self, val: &T, tag: u32 ) -> WriteResult
This is an alias for write_element::<Implicit<T, tag>>
.
sourcepub fn write_optional_implicit_element<T: SimpleAsn1Writable>(
&mut self,
val: &Option<T>,
tag: u32
) -> WriteResult
pub fn write_optional_implicit_element<T: SimpleAsn1Writable>( &mut self, val: &Option<T>, tag: u32 ) -> WriteResult
This is an alias for write_element::<Option<Implicit<T, tag>>>
.
sourcepub fn write_tlv<F: FnOnce(&mut WriteBuf) -> WriteResult>(
&mut self,
tag: Tag,
body: F
) -> WriteResult
pub fn write_tlv<F: FnOnce(&mut WriteBuf) -> WriteResult>( &mut self, tag: Tag, body: F ) -> WriteResult
Writes a TLV with the specified tag where the value is any bytes
written to the Vec
in the callback. The length portion of the
TLV is automatically computed.
Auto Trait Implementations§
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