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 PartialEq for BmpString
impl PartialEq for BmpString
source§impl PartialOrd for BmpString
impl PartialOrd for BmpString
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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.