jupyter_serde::media

Enum MediaType

Source
pub enum MediaType {
Show 25 variants Plain(String), Html(String), Latex(String), Javascript(String), Markdown(String), Svg(String), Png(String), Jpeg(String), Gif(String), Json(JsonObject), GeoJson(JsonObject), DataTable(Box<TabularDataResource>), Plotly(JsonObject), WidgetView(JsonObject), WidgetState(JsonObject), VegaLiteV2(JsonObject), VegaLiteV3(JsonObject), VegaLiteV4(JsonObject), VegaLiteV5(JsonObject), VegaLiteV6(JsonObject), VegaV3(JsonObject), VegaV4(JsonObject), VegaV5(JsonObject), Vdom(JsonObject), Other((String, Value)),
}
Expand description

An enumeration representing various Media types, otherwise known as MIME (Multipurpose Internet Mail Extensions) types. These types are used to indicate the nature of the data in a rich content message such as DisplayData, UpdateDisplayData, and ExecuteResult.

Variants§

§

Plain(String)

Plain text, typically representing unformatted text. (e.g. Python’s _repr_ or _repr_pretty_ methods).

§

Html(String)

HTML, (as displayed via Python’s _repr_html_ method).

§

Latex(String)

LaTeX, (as displayed using Python’s _repr_latex_ method).

§

Javascript(String)

Raw JavaScript code.

§

Markdown(String)

Markdown text, (as displayed using Python’s _repr_markdown_ method).

§

Svg(String)

SVG image text, (as displayed using Python’s _repr_svg_ method).

§

Png(String)

PNG image data.

§

Jpeg(String)

JPEG image data.

§

Gif(String)

GIF image data.

§

Json(JsonObject)

Raw JSON Object

§

GeoJson(JsonObject)

GeoJSON data, a format for encoding a variety of geographic data structures.

§

DataTable(Box<TabularDataResource>)

Data table in JSON format, requires both a data and schema. Example: {data: [{'ghost': true, 'says': "boo"}], schema: {fields: [{name: 'ghost', type: 'boolean'}, {name: 'says', type: 'string'}]}}.

§

Plotly(JsonObject)

Plotly JSON Schema for for rendering graphs and charts.

§

WidgetView(JsonObject)

Jupyter/IPython widget view in JSON format.

§

WidgetState(JsonObject)

Jupyter/IPython widget state in JSON format.

§

VegaLiteV2(JsonObject)

VegaLite data in JSON format for version 2 visualizations.

§

VegaLiteV3(JsonObject)

VegaLite data in JSON format for version 3 visualizations.

§

VegaLiteV4(JsonObject)

VegaLite data in JSON format for version 4 visualizations.

§

VegaLiteV5(JsonObject)

VegaLite data in JSON format for version 5 visualizations.

§

VegaLiteV6(JsonObject)

VegaLite data in JSON format for version 6 visualizations.

§

VegaV3(JsonObject)

Vega data in JSON format for version 3 visualizations.

§

VegaV4(JsonObject)

Vega data in JSON format for version 4 visualizations.

§

VegaV5(JsonObject)

Vega data in JSON format for version 5 visualizations.

§

Vdom(JsonObject)

Represents Virtual DOM (nteract/vdom) data in JSON format.

§

Other((String, Value))

Trait Implementations§

Source§

impl Clone for MediaType

Source§

fn clone(&self) -> MediaType

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MediaType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MediaType

Source§

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 From<MediaType> for Media

Source§

fn from(media_type: MediaType) -> Self

Converts to this type from the input type.
Source§

impl Hash for MediaType

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MediaType

Source§

fn eq(&self, other: &MediaType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MediaType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for MediaType

Source§

impl StructuralPartialEq for MediaType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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