pub struct Str { /* private fields */ }
Expand description
An owned, immutable in-memory representation of an Ion string
.
use ion_rs::Str;
let s: Str = "hello!".into();
assert_eq!(s, "hello!");
Implementations§
Source§impl Str
impl Str
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of UTF-8 encoded bytes in this string.
use ion_rs::Str;
let s: Str = "hello!".into();
assert_eq!(s.len(), 6);
// Note that the length returned is a number of UTF-8 bytes, not codepoints or graphemes.
let s: Str = "🚀🚀🚀".into();
assert_eq!(s.len(), 12);
Trait Implementations§
Source§impl Ord for Str
impl Ord for Str
Source§impl PartialOrd for Str
impl PartialOrd for Str
impl Eq for Str
Auto Trait Implementations§
impl Freeze for Str
impl RefUnwindSafe for Str
impl Send for Str
impl Sync for Str
impl Unpin for Str
impl UnwindSafe for Str
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§impl<V> IntoAnnotatedElement for V
impl<V> IntoAnnotatedElement for V
Source§fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element
fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element
Converts the value into an Element with the specified annotations.