Struct utf8_ranges::ScalarRange [−][src]
Fields
start: u32
end: u32
Methods
impl ScalarRange[src]
impl ScalarRangefn split(&self) -> Option<(ScalarRange, ScalarRange)>[src]
fn split(&self) -> Option<(ScalarRange, ScalarRange)>split splits this range if it overlaps with a surrogate codepoint.
Either or both ranges may be invalid.
fn is_valid(&self) -> bool[src]
fn is_valid(&self) -> boolis_valid returns true if and only if start <= end.
fn as_ascii(&self) -> Option<Utf8Range>[src]
fn as_ascii(&self) -> Option<Utf8Range>as_ascii returns this range as a Utf8Range if and only if all scalar values in this range can be encoded as a single byte.
fn is_ascii(&self) -> bool[src]
fn is_ascii(&self) -> boolis_ascii returns true if the range is ASCII only (i.e., takes a single byte to encode any scalar value).
fn encode(&self, start: &mut [u8], end: &mut [u8]) -> usize[src]
fn encode(&self, start: &mut [u8], end: &mut [u8]) -> usizeencode writes the UTF-8 encoding of the start and end of this range to the corresponding destination slices.
The slices should have room for at least MAX_UTF8_BYTES.
Trait Implementations
impl Debug for ScalarRange[src]
impl Debug for ScalarRangeAuto Trait Implementations
impl Send for ScalarRange
impl Send for ScalarRangeimpl Sync for ScalarRange
impl Sync for ScalarRange