pub struct DNMRange<'dnmrange> {
    pub start: usize,
    pub end: usize,
    pub dnm: &'dnmrange DNM,
}
Expand description

Very often we’ll talk about substrings of the plaintext - words, sentences, etc. A DNMRange stores start and end point of such a substring and has a reference to the DNM.

Fields

start: usize

Offset of the beginning of the range

end: usize

Offset of the end of the range

dnm: &'dnmrange DNM

DNM containing this range

Implementations

Get the plaintext substring corresponding to the range

Get the plaintext without trailing white spaces

Get the first corresponding DOM node for this range

Returns a DNMRange with the leading and trailing whitespaces removed

returns a subrange, with offsets relative to the beginning of self

returns a subrange from a pair of byte offsets (not character offsets, remember, we’re in UTF-8)

checks whether the range is empty

serializes a DNMRange into an XPointer

creates an arange from to xpointers

Serializes a node and an offset into an xpointer is_end indicates whether the node indicates the end of the interval

serializes a node into an xpath expression

deserializes an xpointer into a DNMRange. Note that only a very limited subset of xpointers is supported. Essentially, you should not use it for deserialization of xpointers generated by any other tool. (TODO: Support a wider range of xpointers)

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.