Skip to main content

unpack_value

Function unpack_value 

Source
pub fn unpack_value(
    v: &Value,
    fixed: usize,
    rest: bool,
) -> DogeResult<Vec<Value>>
Expand description

Unpack v into the values a multiple-assignment binds: the same sequence a for loop walks (a List’s elements, a Str’s characters, or a Dict’s keys), split to fixed leading targets plus, when rest is set, a trailing collector that gathers every surplus value into a List. The returned Vec has exactly fixed elements without a collector, or fixed + 1 with one (its last element being the collector List). A non-iterable value or a length that cannot fill the targets is a catchable error, so pls/oh no can handle it.