pub trait StringPosition:
Debug
+ Display
+ Clone
+ Copy
+ PartialEq
+ Eq
+ PartialOrd
+ Ord
+ Default
+ Hash
+ Add<Output = Self>
+ AddAssign
+ Sub<Output = Self>
+ SubAssign
+ Sealed
+ CondSerialize
+ 'static {
const KIND: PositionKind;
// Required methods
fn from_other<P: StringPosition>(p: P, source: &str) -> Self;
fn len(s: &str) -> Self;
fn inc_offset_by(&mut self, text: &str);
fn inc_by(&mut self, c: char);
fn inc_newline(&mut self, crlf: bool);
// Provided methods
fn from_many<P: StringPosition>(
source: &str,
) -> PositionConverter<'_, P, Self> { ... }
fn into_other<P: StringPosition>(self, source: &str) -> P { ... }
fn into_many<P: StringPosition>(
source: &str,
) -> PositionConverter<'_, Self, P> { ... }
fn get_range(start: Self, end: Self, text: &str) -> Option<&str> { ... }
}Required Associated Constantsยง
const KIND: PositionKind
Required Methodsยง
fn from_other<P: StringPosition>(p: P, source: &str) -> Self
fn len(s: &str) -> Self
fn inc_offset_by(&mut self, text: &str)
fn inc_by(&mut self, c: char)
fn inc_newline(&mut self, crlf: bool)
Provided Methodsยง
fn from_many<P: StringPosition>(source: &str) -> PositionConverter<'_, P, Self>
fn into_other<P: StringPosition>(self, source: &str) -> P
fn into_many<P: StringPosition>(source: &str) -> PositionConverter<'_, Self, P>
fn get_range(start: Self, end: Self, text: &str) -> Option<&str>
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".