Enum cursive::utils::span::IndexedCow[][src]

pub enum IndexedCow {
    Borrowed {
        start: usize,
        end: usize,
    },
    Owned(String),
}

A span of text that can be either owned, or indexed in another String.

Variants

Indexes content in a separate string.

Fields of Borrowed

Byte offset of the beginning of the span (inclusive)

Byte offset of the end of the span (exclusive)

Owns its content.

Methods

impl IndexedCow
[src]

Resolve the span to a string slice.

Returns an indexed view of the given item.

Note: it is assumed cow, if borrowed, is a substring of source.

Returns ŧrue if this represents an empty span.

If self is borrowed, offset its indices by the given value.

Useful to update spans when concatenating sources.

Trait Implementations

impl<T> AsRef<IndexedCow> for IndexedSpan<T>
[src]

Performs the conversion.

impl Debug for IndexedCow
[src]

Formats the value using the given formatter. Read more

impl Clone for IndexedCow
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for IndexedCow
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for IndexedCow
[src]

Auto Trait Implementations

impl Send for IndexedCow

impl Sync for IndexedCow