pub struct Array {
pub members: Vec<Node>,
}
Expand description
An array is a list of types in a specific order.
Arrays are expected to take the form of “records” or “vectors”.
A “vector” array is expected to have an arbitrary-length list of a single type, e.g. zero-or-more integers:
[ * int ]
The type in a vector could be something complex, like a group, choice, or another array or map.
A “record” array is a sequence of different values, each with a specific type. It has similar semantics to a rust tuple, though it could also theoretically be used to serialize a struct.
CDDL syntax allows certain nonsensical or ambiguous arrays, for example:
thing = [ * mygroup ]
mygroup = ( a = tstr, b = int)
or
thing = [ * "a" = int, * "b" = int ]
CDDL arrays may be composed of key-value pairs, but the keys are solely for information/debugging; they are ignored for validation purposes.
Fields§
§members: Vec<Node>
Trait Implementations§
source§impl PartialEq for Array
impl PartialEq for Array
impl StructuralPartialEq for Array
Auto Trait Implementations§
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
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