Struct harper_core::Span
source · pub struct Span {
pub start: usize,
pub end: usize,
}
Expand description
A window in a char.
Fields§
§start: usize
§end: usize
Implementations§
source§impl Span
impl Span
pub fn new(start: usize, end: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn overlaps_with(&self, other: Self) -> bool
pub fn get_content<'a>(&self, source: &'a [char]) -> &'a [char]
pub fn get_content_string(&self, source: &[char]) -> String
pub fn set_len(&mut self, length: usize)
pub fn with_len(&self, length: usize) -> Self
pub fn offset(&mut self, by: usize)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Span
impl<'de> Deserialize<'de> for Span
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 Span
Auto Trait Implementations§
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
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