pub enum ParseMode {
Html,
Markdown,
MarkdownV2,
}Expand description
Represents a mode for parsing entities in a text.
See formatting options for more details.
Variants§
Implementations§
Source§impl ParseMode
impl ParseMode
Sourcepub fn escape<T>(self, input: T) -> String
pub fn escape<T>(self, input: T) -> String
Escapes HTML or Markdown special characters.
§Arguments
input- String that will be escaped.
For MarkdownV2 you must escape characters with \ by yourself in the following cases:
- all ` and
\characters in ‘pre’ and ‘code’. (...)- part of inline link definition, all)and\characters.
In all other places use this method to escape special characters.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ParseMode
impl<'de> Deserialize<'de> for ParseMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for ParseMode
impl Ord for ParseMode
Source§impl PartialOrd for ParseMode
impl PartialOrd for ParseMode
impl Copy for ParseMode
impl Eq for ParseMode
impl StructuralPartialEq for ParseMode
Auto Trait Implementations§
impl Freeze for ParseMode
impl RefUnwindSafe for ParseMode
impl Send for ParseMode
impl Sync for ParseMode
impl Unpin for ParseMode
impl UnwindSafe for ParseMode
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.