pub trait StrSlice {
// Required method
fn get_slice<R>(&self, r: R) -> Option<&str>
where R: IndexRange;
}👎Deprecated: Use str::get with a range instead
Expand description
Extension trait for str for string slicing without panicking
Required Methods§
Sourcefn get_slice<R>(&self, r: R) -> Option<&str>where
R: IndexRange,
👎Deprecated: Use str::get with a range instead
fn get_slice<R>(&self, r: R) -> Option<&str>where
R: IndexRange,
Return a slice of the string, if it is in bounds /and on character boundaries/,
otherwise return None
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.