Struct detached_str::StrSlice [−][src]
pub struct StrSlice { /* fields omitted */ }
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
impl StrSlice
[src]
impl StrSlice
[src]pub fn join(self, other: Self) -> Self
[src]
pub fn join(self, other: Self) -> Self
[src]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.
pub fn try_join(self, other: Self) -> Option<Self>
[src]
pub fn try_join(self, other: Self) -> Option<Self>
[src]Joins this slice with another slice. It succeeds if the slices are
adjacent, i.e. self.end == other.start
.
pub fn get<T>(&self, index: T) -> StrSlice where
Self: StrSliceIndex<T>,
[src]
pub fn get<T>(&self, index: T) -> StrSlice where
Self: StrSliceIndex<T>,
[src]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 where
P: FnMut(char) -> bool,
[src]
P: FnMut(char) -> bool,
Trait Implementations
impl Ord for StrSlice
[src]
impl Ord for StrSlice
[src]impl PartialOrd<StrSlice> for StrSlice
[src]
impl PartialOrd<StrSlice> for StrSlice
[src]fn partial_cmp(&self, other: &StrSlice) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &StrSlice) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl StrSliceIndex<Range<usize>> for StrSlice
[src]
impl StrSliceIndex<Range<usize>> for StrSlice
[src]impl StrSliceIndex<RangeFrom<usize>> for StrSlice
[src]
impl StrSliceIndex<RangeFrom<usize>> for StrSlice
[src]impl StrSliceIndex<RangeInclusive<usize>> for StrSlice
[src]
impl StrSliceIndex<RangeInclusive<usize>> for StrSlice
[src]fn index(&self, index: RangeInclusive<usize>) -> StrSlice
[src]
impl StrSliceIndex<RangeTo<usize>> for StrSlice
[src]
impl StrSliceIndex<RangeTo<usize>> for StrSlice
[src]impl StrSliceIndex<RangeToInclusive<usize>> for StrSlice
[src]
impl StrSliceIndex<RangeToInclusive<usize>> for StrSlice
[src]fn index(&self, index: RangeToInclusive<usize>) -> StrSlice
[src]
impl Copy for StrSlice
[src]
impl Eq for StrSlice
[src]
impl StructuralEq for StrSlice
[src]
impl StructuralPartialEq for StrSlice
[src]
Auto Trait Implementations
impl RefUnwindSafe for StrSlice
impl Send for StrSlice
impl Sync for StrSlice
impl Unpin for StrSlice
impl UnwindSafe for StrSlice
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more