pub struct StrSlice { /* private fields */ }Expand description
A memory efficient string slice without a lifetime.
To get the content of the string slice, the original string must be still around.
Implementations§
Source§impl StrSlice
impl StrSlice
Sourcepub fn join(self, other: Self) -> Self
pub fn join(self, other: Self) -> Self
Joins this slice with another slice. The slices must be adjacent, i.e.
self.end == other.start.
§Panics
Panics if the slices aren’t adjacent.
Sourcepub fn try_join(self, other: Self) -> Option<Self>
pub fn try_join(self, other: Self) -> Option<Self>
Joins this slice with another slice. It succeeds if the slices are
adjacent, i.e. self.end == other.start.
Sourcepub fn get<T>(&self, index: T) -> StrSlicewhere
Self: StrSliceIndex<T>,
pub fn get<T>(&self, index: T) -> StrSlicewhere
Self: StrSliceIndex<T>,
Returns a subslice of this slice. This function accepts all kinds of ranges.
pub fn trim_end_matches<P>(self, pattern: P, text: &str) -> StrSlice
Trait Implementations§
Source§impl Ord for StrSlice
impl Ord for StrSlice
Source§impl PartialOrd for StrSlice
impl PartialOrd for StrSlice
Source§impl StrSliceIndex<RangeInclusive<usize>> for StrSlice
impl StrSliceIndex<RangeInclusive<usize>> for StrSlice
Source§impl StrSliceIndex<RangeToInclusive<usize>> for StrSlice
impl StrSliceIndex<RangeToInclusive<usize>> for StrSlice
impl Copy for StrSlice
impl Eq for StrSlice
impl StructuralPartialEq for StrSlice
Auto Trait Implementations§
impl Freeze for StrSlice
impl RefUnwindSafe for StrSlice
impl Send for StrSlice
impl Sync for StrSlice
impl Unpin for StrSlice
impl UnwindSafe for StrSlice
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