Enum tbot::util::entities::Entity [−][src]
pub enum Entity { Code(String), Pre { language: Option<String>, value: String, }, Semantic(SemanticEntity), }
Represents a parsed entity.
Variants
Code(String)
Inline code.
A code block.
Show fields
Semantic(SemanticEntity)
Text that may have semantic meaning.
Implementations
impl Entity
[src]
impl Entity
[src]pub fn is_code(&self) -> bool
[src]
Returns true
if self
is of variant Code
.
pub fn expect_code(self) -> String where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Code
.
Panics
Panics if the value is not Code
, with a panic message including the content of self
.
pub fn code(self) -> Option<String>
[src]
Returns Some
if self
is of variant Code
, and None
otherwise.
pub fn is_pre(&self) -> bool
[src]
Returns true
if self
is of variant Pre
.
pub fn is_semantic(&self) -> bool
[src]
Returns true
if self
is of variant Semantic
.
pub fn expect_semantic(self) -> SemanticEntity where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Semantic
.
Panics
Panics if the value is not Semantic
, with a panic message including the content of self
.
pub fn semantic(self) -> Option<SemanticEntity>
[src]
Returns Some
if self
is of variant Semantic
, and None
otherwise.
Trait Implementations
impl Formattable for Entity
[src]
impl Formattable for Entity
[src]impl Formattable for Entity
[src]
impl Formattable for Entity
[src]impl Eq for Entity
[src]
impl StructuralEq for Entity
[src]
impl StructuralPartialEq for Entity
[src]
Auto Trait Implementations
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnwindSafe for Entity
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Formattable for T where
T: Formattable + Formattable,
[src]
T: Formattable + Formattable,