• Home
  • Raw
  • Download

Lines Matching refs:Value

263 pub fn cbor_type_error<T>(value: &cbor::value::Value, want: &'static str) -> Result<T, CborError> {  in cbor_type_error()  argument
264 use cbor::value::Value; in cbor_type_error()
266 Value::Integer(_) => "int", in cbor_type_error()
267 Value::Bytes(_) => "bstr", in cbor_type_error()
268 Value::Text(_) => "tstr", in cbor_type_error()
269 Value::Array(_) => "array", in cbor_type_error()
270 Value::Map(_) => "map", in cbor_type_error()
271 Value::Tag(_, _) => "tag", in cbor_type_error()
272 Value::Float(_) => "float", in cbor_type_error()
273 Value::Bool(_) => "bool", in cbor_type_error()
274 Value::Null => "null", in cbor_type_error()
282 pub fn read_to_value(mut slice: &[u8]) -> Result<cbor::value::Value, CborError> { in read_to_value() argument
294 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError>; in from_cbor_value()
297 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError>; in to_cbor_value() argument
340 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
342 cbor::value::Value::Tag(tag, inner_value) if tag == coset::CoseEncrypt0::TAG => { in from_cbor_value()
346 cbor::value::Value::Tag(_, _) => Err(CborError::UnexpectedItem("tag", "tag 16")), in from_cbor_value()
350 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
351 Ok(cbor::value::Value::Tag( in to_cbor_value()
363 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
365 cbor::value::Value::Array(a) => a, in from_cbor_value()
375 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
377 Some(t) => Ok(cbor::value::Value::Array(vec_try![t.to_cbor_value()?]?)), in to_cbor_value()
378 None => Ok(cbor::value::Value::Array(Vec::new())), in to_cbor_value()
389 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
391 cbor::value::Value::Array(a) => a, in from_cbor_value()
398 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
400 Ok(cbor::value::Value::Array(values?)) in to_cbor_value()
409 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
411 cbor::value::Value::Bytes(bstr) => Ok(bstr), in from_cbor_value()
416 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
417 Ok(cbor::value::Value::Bytes(self)) in to_cbor_value()
426 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
428 cbor::value::Value::Bytes(bstr) => bstr, in from_cbor_value()
435 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
441 Ok(cbor::value::Value::Bytes(v)) in to_cbor_value()
450 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
452 cbor::value::Value::Text(s) => Ok(s), in from_cbor_value()
457 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
458 Ok(cbor::value::Value::Text(self)) in to_cbor_value()
467 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
469 cbor::value::Value::Integer(i) => { in from_cbor_value()
476 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
477 Ok(cbor::value::Value::Integer(self.into())) in to_cbor_value()
486 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
488 cbor::value::Value::Integer(i) => { in from_cbor_value()
495 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
496 Ok(cbor::value::Value::Integer(self.into())) in to_cbor_value()
505 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
507 cbor::value::Value::Integer(i) => { in from_cbor_value()
514 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
515 Ok(cbor::value::Value::Integer(self.into())) in to_cbor_value()
524 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
526 cbor::value::Value::Bool(b) => Ok(b), in from_cbor_value()
530 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
531 Ok(cbor::value::Value::Bool(self)) in to_cbor_value()
540 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
542 cbor::value::Value::Null => Ok(()), in from_cbor_value()
546 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
547 Ok(cbor::value::Value::Null) in to_cbor_value()
556 fn from_cbor_value(value: cbor::value::Value) -> Result<Self, CborError> { in from_cbor_value()
558 cbor::value::Value::Integer(i) => { in from_cbor_value()
565 fn to_cbor_value(self) -> Result<cbor::value::Value, CborError> { in to_cbor_value() argument
566 Ok(cbor::value::Value::Integer(self.into())) in to_cbor_value()