pub struct LeafDirective {
pub meta: NodeMeta,
pub name: String,
pub label: Vec<Inline>,
pub attributes: Vec<DirectiveAttribute>,
/* private fields */
}Expand description
A leaf directive. Source: ::name[label]{attrs}.
Fields§
§meta: NodeMetaNode metadata (source span).
name: StringThe directive name following the ::.
label: Vec<Inline>The optional [label] inline content.
attributes: Vec<DirectiveAttribute>The optional {attrs} attributes.
Implementations§
Source§impl LeafDirective
impl LeafDirective
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
A leaf directive named name, with no label and no attributes.
Sourcepub fn with_source(
name: impl Into<String>,
text: &str,
definitions: &Definitions,
) -> (Self, Vec<Diagnostic>)
pub fn with_source( name: impl Into<String>, text: &str, definitions: &Definitions, ) -> (Self, Vec<Diagnostic>)
A leaf directive named name whose label is text, built as
Paragraph::with_source builds a paragraph’s content.
Sourcepub fn label_source(&self) -> Option<&str>
pub fn label_source(&self) -> Option<&str>
The text LeafDirective::with_source built the label from.
Trait Implementations§
Source§impl Clone for LeafDirective
impl Clone for LeafDirective
Source§impl Debug for LeafDirective
impl Debug for LeafDirective
impl Eq for LeafDirective
Source§impl From<LeafDirective> for Block
impl From<LeafDirective> for Block
Source§fn from(node: LeafDirective) -> Self
fn from(node: LeafDirective) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LeafDirective
impl PartialEq for LeafDirective
impl StructuralPartialEq for LeafDirective
Auto Trait Implementations§
impl Freeze for LeafDirective
impl RefUnwindSafe for LeafDirective
impl Send for LeafDirective
impl Sync for LeafDirective
impl Unpin for LeafDirective
impl UnsafeUnpin for LeafDirective
impl UnwindSafe for LeafDirective
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