cbor-core 0.5.1

CBOR::Core deterministic encoder/decoder with owned data structures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

impl<I: Into<Value>> Index<I> for Value {
    type Output = Value;

    fn index(&self, index: I) -> &Value {
        self.get(index)
            .expect("value should be an array or map containing the given key")
    }
}

impl<I: Into<Value>> IndexMut<I> for Value {
    fn index_mut(&mut self, index: I) -> &mut Value {
        self.get_mut(index)
            .expect("value should be an array or map containing the given key")
    }
}