Type Alias StatementList

Source
pub type StatementList = MapList<Statement>;
Expand description

A list of statements. In JSON, this may be an object or an array of objects.

Aliased Type§

struct StatementList { /* private fields */ }

Implementations

Source§

impl<E> MapList<E>

Source

pub fn kind(&self) -> JsonRep

Returns the JSON representation of the list.

Source

pub fn as_slice(&self) -> &[E]

Returns the elements of the list as a slice.

Source

pub fn to_vec(&self) -> Vec<&E>

Returns the elements of the list as a vector of references.

Source

pub fn is_empty(&self) -> bool

Returns true if the list is empty.

Source

pub fn len(&self) -> usize

Returns the number of elements in the list.

Trait Implementations

Source§

impl<E> Clone for MapList<E>
where E: Clone,

Source§

fn clone(&self) -> Self

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<E> Debug for MapList<E>
where E: Debug,

Source§

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

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

impl<'de, E: Deserialize<'de>> Deserialize<'de> for MapList<E>

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

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

impl<E: Serialize> Display for MapList<E>

Source§

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

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

impl<E> From<E> for MapList<E>

Source§

fn from(v: E) -> Self

Converts to this type from the input type.
Source§

impl<E> From<Vec<E>> for MapList<E>

Source§

fn from(v: Vec<E>) -> Self

Converts to this type from the input type.
Source§

impl<E, I> Index<I> for MapList<E>
where I: SliceIndex<[E]>,

Source§

type Output = <I as SliceIndex<[E]>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &<Vec<E> as Index<I>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<E> PartialEq for MapList<E>
where E: PartialEq,

Source§

fn eq(&self, other: &Self) -> 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<E: Serialize> Serialize for MapList<E>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

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

impl<E> Deref for MapList<E>

Source§

type Target = [E]

The resulting type after dereferencing.
Source§

fn deref(&self) -> &[E]

Dereferences the value.
Source§

impl<E> Eq for MapList<E>
where E: Eq,