Struct asn1_der::typed::Utf8String

source ·
pub struct Utf8String<'a> { /* private fields */ }
Expand description

An ASN.1-DER UTF-8 string view

Implementations§

source§

impl<'a> Utf8String<'a>

source

pub fn new<S: Sink + Into<&'a [u8]>>( value: &str, sink: S ) -> Result<Self, Asn1DerError>

Writes a new UTF8String object with value into sink and returns a type view over it

source

pub fn get(&self) -> &str

Gets the UTF-8 string value

source

pub fn write<S: Sink>(value: &str, sink: &mut S) -> Result<(), Asn1DerError>

Writes an UTF-8 string value as DER-object to sink

Trait Implementations§

source§

impl<'a> Clone for Utf8String<'a>

source§

fn clone(&self) -> Utf8String<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> DerDecodable<'a> for Utf8String<'a>

source§

fn load(object: DerObject<'a>) -> Result<Self, Asn1DerError>

Loads object as Self
source§

fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>

Decodes an object as Self
source§

fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>

Decodes an object as Self
source§

fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>( source: &mut A, sink: B ) -> Result<Self, Asn1DerError>

Reads an object from source by parsing the length field and copying the necessary bytes into sink and decoding it from sink
source§

impl<'a> DerEncodable for Utf8String<'a>

source§

fn encode<U: Sink>(&self, sink: &mut U) -> Result<(), Asn1DerError>

Encodes self to sink

source§

fn der_object<'a, S: Sink + Into<&'a [u8]>>( &self, sink: S ) -> Result<DerObject<'a>, Asn1DerError>

Creates an DER object from an encodable type
source§

impl<'a> DerTypeView<'a> for Utf8String<'a>

source§

const TAG: u8 = 12u8

The tag for this type
source§

fn object(&self) -> DerObject<'a>

Provides raw access to the underlying DerObject
source§

impl<'a> Copy for Utf8String<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Utf8String<'a>

§

impl<'a> Send for Utf8String<'a>

§

impl<'a> Sync for Utf8String<'a>

§

impl<'a> Unpin for Utf8String<'a>

§

impl<'a> UnwindSafe for Utf8String<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.