pub struct Utf16Range { /* private fields */ }Expand description
0-based half-open range in UTF-16 code units.
Use this when interoperating with JavaScript-style string ranges. The named endpoints avoid confusing UTF-16 offsets with byte ranges or line/column pairs.
Implementations§
Source§impl Utf16Range
impl Utf16Range
Sourcepub const fn new(start: Utf16Offset, end: Utf16Offset) -> Self
pub const fn new(start: Utf16Offset, end: Utf16Offset) -> Self
Creates a UTF-16 range from inclusive start and exclusive end offsets.
Sourcepub const fn start(self) -> Utf16Offset
pub const fn start(self) -> Utf16Offset
Inclusive 0-based start offset in UTF-16 code units.
Sourcepub const fn end(self) -> Utf16Offset
pub const fn end(self) -> Utf16Offset
Exclusive 0-based end offset in UTF-16 code units.
Trait Implementations§
Source§impl Clone for Utf16Range
impl Clone for Utf16Range
Source§fn clone(&self) -> Utf16Range
fn clone(&self) -> Utf16Range
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Utf16Range
Source§impl Debug for Utf16Range
impl Debug for Utf16Range
impl Eq for Utf16Range
Source§impl Hash for Utf16Range
impl Hash for Utf16Range
Source§impl PartialEq for Utf16Range
impl PartialEq for Utf16Range
Source§fn eq(&self, other: &Utf16Range) -> bool
fn eq(&self, other: &Utf16Range) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Utf16Range
Auto Trait Implementations§
impl Freeze for Utf16Range
impl RefUnwindSafe for Utf16Range
impl Send for Utf16Range
impl Sync for Utf16Range
impl Unpin for Utf16Range
impl UnsafeUnpin for Utf16Range
impl UnwindSafe for Utf16Range
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