pub struct WireRange {
pub start: WirePosition,
pub end: WirePosition,
}Expand description
A protocol-facing LSP range with inclusive start and exclusive end.
Fields§
§start: WirePositionStart position of the range (inclusive).
end: WirePositionEnd position of the range (exclusive).
Implementations§
Source§impl WireRange
impl WireRange
Sourcepub fn new(start: WirePosition, end: WirePosition) -> WireRange
pub fn new(start: WirePosition, end: WirePosition) -> WireRange
Creates a new range from start and end positions.
Sourcepub fn from_byte_offsets(
source: &str,
start_byte: usize,
end_byte: usize,
) -> WireRange
pub fn from_byte_offsets( source: &str, start_byte: usize, end_byte: usize, ) -> WireRange
Builds a wire range from start/end byte offsets in source.
Sourcepub fn empty(pos: WirePosition) -> WireRange
pub fn empty(pos: WirePosition) -> WireRange
Creates an empty (cursor) range at pos.
Sourcepub fn whole_document(source: &str) -> WireRange
pub fn whole_document(source: &str) -> WireRange
Creates a range that spans the full document.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WireRange
impl<'de> Deserialize<'de> for WireRange
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WireRange, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WireRange, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for WireRange
impl Serialize for WireRange
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
impl Copy for WireRange
impl Eq for WireRange
impl StructuralPartialEq for WireRange
Auto Trait Implementations§
impl Freeze for WireRange
impl RefUnwindSafe for WireRange
impl Send for WireRange
impl Sync for WireRange
impl Unpin for WireRange
impl UnsafeUnpin for WireRange
impl UnwindSafe for WireRange
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