[][src]Struct tamasfe_lsp_types::MarkupContent

pub struct MarkupContent {
    pub kind: MarkupKind,
    pub value: String,
}

A MarkupContent literal represents a string value which content can be represented in different formats. Currently plaintext and markdown are supported formats. A MarkupContent is usually used in documentation properties of result literals like CompletionItem or SignatureInformation. If the format is markdown the content should follow the GitHub Flavored Markdown Specification.

Here is an example how such a string can be constructed using JavaScript / TypeScript:

This example is not tested
let markdown: MarkupContent = {
    kind: MarkupKind::Markdown,
    value: [
        "# Header",
        "Some text",
        "```typescript",
        "someCode();",
        "```"
    ]
    .join("\n"),
};

Please Note* that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.

Fields

kind: MarkupKindvalue: String

Trait Implementations

impl Clone for MarkupContent[src]

impl Debug for MarkupContent[src]

impl<'de> Deserialize<'de> for MarkupContent[src]

impl Eq for MarkupContent[src]

impl PartialEq<MarkupContent> for MarkupContent[src]

impl Serialize for MarkupContent[src]

impl StructuralEq for MarkupContent[src]

impl StructuralPartialEq for MarkupContent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.