pub struct TextRange {
pub start: TextPos,
pub end: TextPos,
}
Expand description
Defines a range (i.e., a span of positions).
Fields§
§start: TextPos
The start position (inclusive) in the range.
end: TextPos
The end position (inclusive) in the range.
Implementations§
source§impl TextRange
impl TextRange
sourcepub const fn none() -> Self
pub const fn none() -> Self
Constructor for the TextRange that initializes it to ‘none’.
§Returns
A new TextRange instance that represents ‘no range’.
Trait Implementations§
source§impl<'de> Deserialize<'de> for TextRange
impl<'de> Deserialize<'de> for TextRange
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: AsBytes, X> From<&LocatedSpan<T, X>> for TextRange
impl<T: AsBytes, X> From<&LocatedSpan<T, X>> for TextRange
source§fn from(value: &LocatedSpan<T, X>) -> Self
fn from(value: &LocatedSpan<T, X>) -> Self
Converts to this type from the input type.
source§impl<T1: AsBytes, T2: AsBytes, X1, X2> From<(&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)> for TextRange
impl<T1: AsBytes, T2: AsBytes, X1, X2> From<(&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)> for TextRange
source§fn from(value: (&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)) -> Self
fn from(value: (&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)) -> Self
Converts to this type from the input type.
source§impl<T1: AsBytes, T2: AsBytes, X1, X2> From<(LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)> for TextRange
impl<T1: AsBytes, T2: AsBytes, X1, X2> From<(LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)> for TextRange
source§fn from(value: (LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)) -> Self
fn from(value: (LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)) -> Self
Converts to this type from the input type.
source§impl<T: AsBytes, X> From<LocatedSpan<T, X>> for TextRange
impl<T: AsBytes, X> From<LocatedSpan<T, X>> for TextRange
source§fn from(value: LocatedSpan<T, X>) -> Self
fn from(value: LocatedSpan<T, X>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TextRange
impl RefUnwindSafe for TextRange
impl Send for TextRange
impl Sync for TextRange
impl Unpin for TextRange
impl UnwindSafe for TextRange
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request