Enum gray_matter::Pod[][src]

pub enum Pod {
    Null,
    String(String),
    Integer(i64),
    Float(f64),
    Boolean(bool),
    Array(Vec<Pod>),
    Hash(HashMap<String, Pod>),
}
Expand description

A polyglot data type for representing the parsed front matter.

Any Engine has to convert the data represented by the format into a Pod. This ensures we can use the parsed data similarly, regardless of the format it is parsed from.

Variants

Null
String

Tuple Fields of String

0: String
Integer

Tuple Fields of Integer

0: i64
Float

Tuple Fields of Float

0: f64
Boolean

Tuple Fields of Boolean

0: bool
Array

Tuple Fields of Array

0: Vec<Pod>
Hash

Tuple Fields of Hash

0: HashMap<String, Pod>

Implementations

Deserialize a Pod into any struct that implements Deserialize.

Note: The function coerces self into a serde_json::Value in order to work around implementing a custom Deserializer for Pod.

Pushes a new value into Pod::Array.

Pops either the last element or null from Pod::Array.

Inserts a key value pair into or override the exist one in Pod::Hash.

Removes the value of specific key from Pod::Hash and returns it or null if not exists.

Takes the ownership of Pod

Returns length of Pod::Array and Pod::Hash, 0 as default for other types.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Easily access value of Pod::Hash by &str index

The returned type after indexing.

Easily access value of Pod::Hash by String index

The returned type after indexing.

Easily access element of Pod::Array by usize index

The returned type after indexing.

Easily access mutable value of Pod::Hash by &str index

Easily access value of Pod::Hash by String index

Easily access mutable element of Pod::Array by usize index

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.