Struct nlprule::types::Span [−][src]
pub struct Span { /* fields omitted */ }
A span in a text determined by start (inclusive) and end (exclusive) position. The start must always be greater than or equal to the end.
Implementations
impl Span
[src]
pub fn from_positions(start: Position, end: Position) -> Self
[src]
pub fn new(byte: Range<usize>, char: Range<usize>) -> Self
[src]
Creates a new span from a byte and char range.
pub fn start(&self) -> Position
[src]
Gets the start position.
pub fn end(&self) -> Position
[src]
Gets the end position.
pub fn byte(&self) -> &Range<usize>
[src]
Gets the byte range.
pub fn char(&self) -> &Range<usize>
[src]
Gets the char range.
pub fn is_empty(&self) -> bool
[src]
Checks whether this span is empty.y
pub fn len(&self) -> Position
[src]
Gets the length of this span.
pub fn set_start(&mut self, start: Position)
[src]
Sets the start position.
pub fn set_end(&mut self, end: Position)
[src]
Sets the end position.
pub fn rshift(self, position: Position) -> Self
[src]
Shift the span right by the specified amount.
pub fn lshift(self, position: Position) -> Self
[src]
Shift the span left by the specified amount. Clips at zero if the resulting span would have a negative component.
Trait Implementations
impl Clone for Span
[src]
impl Debug for Span
[src]
impl Default for Span
[src]
impl<'de> Deserialize<'de> for Span
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Span
[src]
impl Hash for Span
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Span> for Span
[src]
impl Serialize for Span
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Span
[src]
impl StructuralPartialEq for Span
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,