pub struct ContainerDirective {
pub meta: NodeMeta,
pub name: String,
pub label: Vec<Inline>,
pub attributes: Vec<DirectiveAttribute>,
pub children: Vec<Block>,
/* private fields */
}Expand description
A container 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.
children: Vec<Block>The directive’s enclosed block content.
Implementations§
Source§impl ContainerDirective
impl ContainerDirective
Sourcepub fn new(name: impl Into<String>, children: Vec<Block>) -> Self
pub fn new(name: impl Into<String>, children: Vec<Block>) -> Self
A container directive named name holding children, with no label
and no attributes.
Sourcepub fn with_source(
name: impl Into<String>,
text: &str,
children: Vec<Block>,
definitions: &Definitions,
) -> (Self, Vec<Diagnostic>)
pub fn with_source( name: impl Into<String>, text: &str, children: Vec<Block>, definitions: &Definitions, ) -> (Self, Vec<Diagnostic>)
A container directive named name holding children, 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 ContainerDirective::with_source built the label from.
Trait Implementations§
Source§impl Clone for ContainerDirective
impl Clone for ContainerDirective
Source§impl Debug for ContainerDirective
impl Debug for ContainerDirective
impl Eq for ContainerDirective
Source§impl From<ContainerDirective> for Block
impl From<ContainerDirective> for Block
Source§fn from(node: ContainerDirective) -> Self
fn from(node: ContainerDirective) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ContainerDirective
impl PartialEq for ContainerDirective
impl StructuralPartialEq for ContainerDirective
Auto Trait Implementations§
impl Freeze for ContainerDirective
impl RefUnwindSafe for ContainerDirective
impl Send for ContainerDirective
impl Sync for ContainerDirective
impl Unpin for ContainerDirective
impl UnsafeUnpin for ContainerDirective
impl UnwindSafe for ContainerDirective
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