Enum minijinja::value::ObjectRepr
source · #[non_exhaustive]pub enum ObjectRepr {
Plain,
Map,
Seq,
Iterable,
}
Expand description
Defines the natural representation of this object.
An ObjectRepr
is a reduced form of
ValueKind
which only contains value which can
be represented by objects. For instance an object can never be a primitive
and as such those kinds are unavailable.
The representation influences how values are serialized, stringified or what kind they report.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Plain
An object that has no reasonable representation.
Map
Represents a map or object.
- Default Render:
{key: value,...}
pairs - Collection Behavior: looks like a map, can be indexed by key, has a length
- Iteration Behavior: iterates over keys
- Serialize: Serializes as map
Seq
Represents a sequence (eg: array/list).
- Default Render:
[value,...]
- Collection Behavior: looks like a list, can be indexed by index, has a length
- Iteration Behavior: iterates over values
- Serialize: Serializes as list
Iterable
Represents a non indexable, iterable object.
- Default Render:
[value,...]
(if length is known),"<iterator>"
otherwise. - Collection Behavior: looks like a list if length is known, cannot be indexed
- Iteration Behavior: iterates over values
- Serialize: Serializes as list
Trait Implementations§
source§impl Clone for ObjectRepr
impl Clone for ObjectRepr
source§fn clone(&self) -> ObjectRepr
fn clone(&self) -> ObjectRepr
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ObjectRepr
impl Debug for ObjectRepr
source§impl Hash for ObjectRepr
impl Hash for ObjectRepr
source§impl Ord for ObjectRepr
impl Ord for ObjectRepr
source§fn cmp(&self, other: &ObjectRepr) -> Ordering
fn cmp(&self, other: &ObjectRepr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ObjectRepr
impl PartialEq for ObjectRepr
source§fn eq(&self, other: &ObjectRepr) -> bool
fn eq(&self, other: &ObjectRepr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ObjectRepr
impl PartialOrd for ObjectRepr
source§fn partial_cmp(&self, other: &ObjectRepr) -> Option<Ordering>
fn partial_cmp(&self, other: &ObjectRepr) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ObjectRepr
impl Eq for ObjectRepr
impl StructuralPartialEq for ObjectRepr
Auto Trait Implementations§
impl Freeze for ObjectRepr
impl RefUnwindSafe for ObjectRepr
impl Send for ObjectRepr
impl Sync for ObjectRepr
impl Unpin for ObjectRepr
impl UnwindSafe for ObjectRepr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)