pub struct Range {
pub start: Position,
pub end: Position,
pub start_byte: u32,
pub end_byte: u32,
}Fields§
§start: Position§end: Position§start_byte: u32§end_byte: u32Implementations§
Source§impl Range
impl Range
pub fn new( start: Position, end: Position, start_byte: u32, end_byte: u32, ) -> Self
pub fn from_byte_range(source: &str, byte_range: &ByteRange) -> Self
pub fn add(&mut self, other: Position, other_byte: u32)
pub fn range_index(&self) -> Range<usize>
pub fn from_byteless(range: RangeWithoutByte, str: &str) -> Self
pub fn adjust_columns(&mut self, start: i32, end: i32) -> bool
pub fn get_line_range( &self, line: u32, line_length: u32, ) -> Option<(usize, usize)>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Range
impl<'de> Deserialize<'de> for Range
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 From<Range> for RangeWithoutByte
impl From<Range> for RangeWithoutByte
Source§impl Ord for Range
impl Ord for Range
Source§impl PartialOrd for Range
impl PartialOrd for Range
impl Copy for Range
impl Eq for Range
impl StructuralPartialEq for Range
Auto Trait Implementations§
impl Freeze for Range
impl RefUnwindSafe for Range
impl Send for Range
impl Sync for Range
impl Unpin for Range
impl UnwindSafe for Range
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