jupyter_protocol::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(Map<String, Value>), GeoJson(Map<String, Value>), DataTable(Box<TabularDataResource>), Plotly(Map<String, Value>), WidgetView(Map<String, Value>), WidgetState(Map<String, Value>), VegaLiteV2(Map<String, Value>), VegaLiteV3(Map<String, Value>), VegaLiteV4(Map<String, Value>), VegaLiteV5(Map<String, Value>), VegaLiteV6(Map<String, Value>), VegaV3(Map<String, Value>), VegaV4(Map<String, Value>), VegaV5(Map<String, Value>), Vdom(Map<String, Value>), 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(Map<String, Value>)

Raw JSON Object

§

GeoJson(Map<String, Value>)

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(Map<String, Value>)

Plotly JSON Schema for for rendering graphs and charts.

§

WidgetView(Map<String, Value>)

Jupyter/IPython widget view in JSON format.

§

WidgetState(Map<String, Value>)

Jupyter/IPython widget state in JSON format.

§

VegaLiteV2(Map<String, Value>)

VegaLite data in JSON format for version 2 visualizations.

§

VegaLiteV3(Map<String, Value>)

VegaLite data in JSON format for version 3 visualizations.

§

VegaLiteV4(Map<String, Value>)

VegaLite data in JSON format for version 4 visualizations.

§

VegaLiteV5(Map<String, Value>)

VegaLite data in JSON format for version 5 visualizations.

§

VegaLiteV6(Map<String, Value>)

VegaLite data in JSON format for version 6 visualizations.

§

VegaV3(Map<String, Value>)

Vega data in JSON format for version 3 visualizations.

§

VegaV4(Map<String, Value>)

Vega data in JSON format for version 4 visualizations.

§

VegaV5(Map<String, Value>)

Vega data in JSON format for version 5 visualizations.

§

Vdom(Map<String, Value>)

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<(), Error>

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

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

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MediaType, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<MediaType> for DisplayData

Source§

fn from(content: MediaType) -> Self

Converts to this type from the input type.
Source§

impl From<MediaType> for Media

Source§

fn from(media_type: MediaType) -> Media

Converts to this type from the input type.
Source§

impl Hash for MediaType

Source§

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

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 as Serializer>::Ok, <__S as Serializer>::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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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