Enum minijinja::value::ObjectKind
source · #[non_exhaustive]
pub enum ObjectKind<'a> {
Plain,
Seq(&'a dyn SeqObject),
Struct(&'a dyn StructObject),
}
Expand description
A kind defines the object’s behavior.
When a dynamic Object
is implemented, it can be of one of the kinds
here. The default behavior will be a Plain
object which
doesn’t do much other than that it can be printed. For an object to turn
into a struct or sequence the necessary kind
has to be returned with a pointer to itself.
Today object’s can have the behavior of structs and sequences but this might expand in the future. It does mean that not all types of values can be represented by objects.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Plain
This object is a plain object.
Such an object has no attributes but it might be callable and it can be stringified. When serialized it’s serialized in it’s stringified form.
Seq(&'a dyn SeqObject)
This object is a sequence.
Requires that the object implements SeqObject
.
Struct(&'a dyn StructObject)
This object is a struct (map with string keys).
Requires that the object implements StructObject
.