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() -> TextRange
pub const fn none() -> TextRange
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<TextRange, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextRange, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T, X> From<&LocatedSpan<T, X>> for TextRangewhere
T: AsBytes,
impl<T, X> From<&LocatedSpan<T, X>> for TextRangewhere
T: AsBytes,
source§fn from(value: &LocatedSpan<T, X>) -> TextRange
fn from(value: &LocatedSpan<T, X>) -> TextRange
Converts to this type from the input type.
source§impl<T1, T2, X1, X2> From<(&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)> for TextRange
impl<T1, T2, X1, X2> From<(&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)> for TextRange
source§fn from(value: (&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)) -> TextRange
fn from(value: (&LocatedSpan<T1, X1>, &LocatedSpan<T2, X2>)) -> TextRange
Converts to this type from the input type.
source§impl<T1, T2, X1, X2> From<(LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)> for TextRange
impl<T1, T2, X1, X2> From<(LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)> for TextRange
source§fn from(value: (LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)) -> TextRange
fn from(value: (LocatedSpan<T1, X1>, LocatedSpan<T2, X2>)) -> TextRange
Converts to this type from the input type.
source§impl<T, X> From<LocatedSpan<T, X>> for TextRangewhere
T: AsBytes,
impl<T, X> From<LocatedSpan<T, X>> for TextRangewhere
T: AsBytes,
source§fn from(value: LocatedSpan<T, X>) -> TextRange
fn from(value: LocatedSpan<T, X>) -> TextRange
Converts to this type from the input type.
source§impl Serialize for TextRange
impl Serialize for TextRange
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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