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) -> Self
pub fn new(start: WirePosition, end: WirePosition) -> Self
Creates a new range from start and end positions.
Sourcepub fn from_byte_offsets(
source: &str,
start_byte: usize,
end_byte: usize,
) -> Self
pub fn from_byte_offsets( source: &str, start_byte: usize, end_byte: usize, ) -> Self
Builds a wire range from start/end byte offsets in source.
Sourcepub fn empty(pos: WirePosition) -> Self
pub fn empty(pos: WirePosition) -> Self
Creates an empty (cursor) range at pos.
Sourcepub fn whole_document(source: &str) -> Self
pub fn whole_document(source: &str) -> Self
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<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
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