Struct utf8_ranges::ScalarRange[][src]

struct ScalarRange {
    start: u32,
    end: u32,
}

Fields

Methods

impl ScalarRange
[src]

split splits this range if it overlaps with a surrogate codepoint.

Either or both ranges may be invalid.

is_valid returns true if and only if start <= end.

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.

is_ascii returns true if the range is ASCII only (i.e., takes a single byte to encode any scalar value).

encode 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]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for ScalarRange

impl Sync for ScalarRange