pub struct BmpString { /* private fields */ }
Expand description
ASN.1 BMPString
type.
Encodes Basic Multilingual Plane (BMP) subset of Unicode (ISO 10646), a.k.a. UCS-2.
Implementations§
Source§impl BmpString
impl BmpString
Sourcepub fn from_ucs2(bytes: impl Into<Box<[u8]>>) -> Result<Self>
pub fn from_ucs2(bytes: impl Into<Box<[u8]>>) -> Result<Self>
Create a new BmpString
from its UCS-2 encoding.
Sourcepub fn into_bytes(self) -> Box<[u8]>
pub fn into_bytes(self) -> Box<[u8]>
Obtain the inner bytes.
Sourcepub fn chars(&self) -> impl Iterator<Item = char> + '_
pub fn chars(&self) -> impl Iterator<Item = char> + '_
Get an iterator over characters in the string.
Sourcepub fn codepoints(&self) -> impl Iterator<Item = u16> + '_
pub fn codepoints(&self) -> impl Iterator<Item = u16> + '_
Get an iterator over the u16
codepoints.
Trait Implementations§
Source§impl<'a> DecodeValue<'a> for BmpString
impl<'a> DecodeValue<'a> for BmpString
Source§impl EncodeValue for BmpString
impl EncodeValue for BmpString
Source§impl Ord for BmpString
impl Ord for BmpString
Source§impl PartialOrd for BmpString
impl PartialOrd for BmpString
impl Eq for BmpString
impl StructuralPartialEq for BmpString
Auto Trait Implementations§
impl Freeze for BmpString
impl RefUnwindSafe for BmpString
impl Send for BmpString
impl Sync for BmpString
impl Unpin for BmpString
impl UnwindSafe for BmpString
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.