Skip to main content

OwnedSegment

Type Alias OwnedSegment 

Source
pub type OwnedSegment = Segment<'static>;
Expand description

A Segment that owns all of its text.

Just Segment<'static> — the shape from_reader produces, because a stream has no buffer to borrow from. It is accepted anywhere a &[Segment<'_>] is wanted.

Aliased Type§

pub struct OwnedSegment {
    pub tag: Cow<'static, str>,
    pub span: Span,
    pub tag_span: Span,
    pub elements: Vec<Element<'static>>,
}

Fields§

§tag: Cow<'static, str>

Segment tag — three ASCII uppercase letters for anything this crate parses.

§span: Span

Span covering the whole segment payload.

§tag_span: Span

Span covering only the segment tag.

§elements: Vec<Element<'static>>

Segment elements in positional order.