pub struct SmtString { /* private fields */ }
Expand description
Internal representation of an SMT string
- s = a vector of SMT character. Each character is a 32bit unsigned integer
- maximal length = 2^31-1
Implementations§
Source§impl SmtString
impl SmtString
Sourcepub fn is_unicode(&self) -> bool
pub fn is_unicode(&self) -> bool
Check whether all SMT chars are valid unicode
Sourcepub fn to_unicode_string(&self) -> String
pub fn to_unicode_string(&self) -> String
Convert to a regular string
- any char that’s not a valid unicode code point is replaced by U+FFFD
Trait Implementations§
Source§impl From<&[u32]> for SmtString
Construct an SmtString from a slice or array of integers.
impl From<&[u32]> for SmtString
Construct an SmtString from a slice or array of integers.
Any element of a not in the range [0, 0x2ffff] is replaced by 0xfffd.
§Example
use aws_smt_strings::smt_strings::*;
assert_eq!(SmtString::from(&[97, 98, 99]), SmtString::from("abc"));
Source§impl From<&str> for SmtString
Construct an SmtString from a UTF8 string x
impl From<&str> for SmtString
Construct an SmtString from a UTF8 string x
§Example
use aws_smt_strings::smt_strings::*;
assert_eq!(SmtString::from(""), EMPTY);
assert_eq!(SmtString::from("\u{0331}"), SmtString::from(0x331));
Source§impl From<u32> for SmtString
Construct a single-character string from integer x.
impl From<u32> for SmtString
Construct a single-character string from integer x.
Convert x to 0xfffd if it’s not a valid character (i.e., if x is not in the range [0, 0x2ffff])
impl Eq for SmtString
impl StructuralPartialEq for SmtString
Auto Trait Implementations§
impl Freeze for SmtString
impl RefUnwindSafe for SmtString
impl Send for SmtString
impl Sync for SmtString
impl Unpin for SmtString
impl UnwindSafe for SmtString
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