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<Str> for Str
impl PartialOrd<Str> for Str
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 Str
impl StructuralEq for Str
Auto Trait Implementations§
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<V> IntoAnnotatedElement for Vwhere
V: Into<Value>,
impl<V> IntoAnnotatedElement for Vwhere V: Into<Value>,
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.