pub struct DocumentTitle {
pub content: TextContent,
pub subtitle: Option<TextContent>,
pub location: Range,
}Expand description
A first-class document title element.
Represents the title of a Lex document — a single unindented line at the start of the document, followed by blank lines, with no indented content after. This is distinct from session titles.
An optional subtitle is supported: when the title line ends with a colon and a second non-blank, non-indented line follows before the blank separator, the second line is parsed as a subtitle. The trailing colon is structural (stripped from the title content).
Fields§
§content: TextContent§subtitle: Option<TextContent>§location: RangeImplementations§
Source§impl DocumentTitle
impl DocumentTitle
pub fn new(content: TextContent, location: Range) -> Self
pub fn with_subtitle( content: TextContent, subtitle: TextContent, location: Range, ) -> Self
pub fn from_string(text: String, location: Range) -> Self
pub fn as_str(&self) -> &str
pub fn subtitle_str(&self) -> Option<&str>
Trait Implementations§
Source§impl AstNode for DocumentTitle
impl AstNode for DocumentTitle
Source§impl Clone for DocumentTitle
impl Clone for DocumentTitle
Source§fn clone(&self) -> DocumentTitle
fn clone(&self) -> DocumentTitle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentTitle
impl Debug for DocumentTitle
Source§impl PartialEq for DocumentTitle
impl PartialEq for DocumentTitle
impl StructuralPartialEq for DocumentTitle
Auto Trait Implementations§
impl Freeze for DocumentTitle
impl RefUnwindSafe for DocumentTitle
impl Send for DocumentTitle
impl Sync for DocumentTitle
impl Unpin for DocumentTitle
impl UnsafeUnpin for DocumentTitle
impl UnwindSafe for DocumentTitle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more