pub enum Entity {
Code(String),
Pre {
language: Option<String>,
value: String,
},
Semantic(SemanticEntity),
}
Expand description
Represents a parsed entity.
Variants§
Code(String)
Inline code.
Pre
A code block.
Semantic(SemanticEntity)
Text that may have semantic meaning.
Implementations§
source§impl Entity
impl Entity
sourcepub fn expect_code(self) -> Stringwhere
Self: Debug,
pub fn expect_code(self) -> Stringwhere
Self: Debug,
sourcepub fn code(self) -> Option<String>
pub fn code(self) -> Option<String>
Returns Some
if self
is of variant Code
, and None
otherwise.
sourcepub fn is_semantic(&self) -> bool
pub fn is_semantic(&self) -> bool
Returns true
if self
is of variant Semantic
.
sourcepub fn expect_semantic(self) -> SemanticEntitywhere
Self: Debug,
pub fn expect_semantic(self) -> SemanticEntitywhere
Self: Debug,
sourcepub fn semantic(self) -> Option<SemanticEntity>
pub fn semantic(self) -> Option<SemanticEntity>
Returns Some
if self
is of variant Semantic
, and None
otherwise.