[−][src]Struct sub_strs::SubStr
A sub string
This struct is used by SubStrIter, which can be made via sub_strs().
You can dereference this struct to &str. It can also give you start and end indexes of the original string.
Methods
impl<'_> SubStr<'_>[src]
pub fn start(&self) -> usize[src]
pub fn end(&self) -> usize[src]
pub fn inner(&self) -> &str[src]
Inner string between start and end phrases
Examples
use core::str::FromStr; let sample = "some_id: 99,"; let some_id = sub_strs::sub_strs(sample, "some_id:", ",").next().unwrap(); assert_eq!(u8::from_str(some_id.inner().trim()).unwrap(), 99);
Trait Implementations
impl<'a> Debug for SubStr<'a>[src]
impl<'_> PartialEq<str> for SubStr<'_>[src]
impl<'a, '_> PartialEq<SubStr<'a>> for &'_ str[src]
fn eq(&self, other: &SubStr<'a>) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> PartialEq<String> for SubStr<'_>[src]
impl<'a> PartialEq<SubStr<'a>> for String[src]
fn eq(&self, other: &SubStr<'a>) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> Deref for SubStr<'_>[src]
Auto Trait Implementations
impl<'a> Unpin for SubStr<'a>
impl<'a> Send for SubStr<'a>
impl<'a> Sync for SubStr<'a>
impl<'a> UnwindSafe for SubStr<'a>
impl<'a> RefUnwindSafe for SubStr<'a>
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,