Struct cbor_data::SingleBuilder [−][src]
pub struct SingleBuilder<'a, 'b>(_);Expand description
Builder for the single value of a dict key.
This builder can be used for exactly one item (which may be a complex one, like an array)
and returns a SingleResult to prove to its
DictWriter that it has been used.
Trait Implementations
type Output = SingleResult
Configured maximum array or dict length up to which definite size encoding is used.
Write a unsigned value of up to 64 bits. Tags are from outer to inner. Read more
Write a negative value of up to 64 bits — the represented number is -1 - value.
Tags are from outer to inner. Read more
Write the given slice as a definite size byte string. Tags are from outer to inner. Read more
Write the given slice as a definite size string. Tags are from outer to inner. Read more
Tags are from outer to inner.
Tags are from outer to inner.
Tags are from outer to inner.
Write custom literal value — RFC 8949 §3.3 is required reading. Tags are from outer to inner. Read more
fn write_array<F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> Self::Output where
F: FnOnce(&mut ArrayWriter<'_>),
fn write_array<F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> Self::Output where
F: FnOnce(&mut ArrayWriter<'_>),
Write a nested array using the given closure that receives an array builder. Tags are from outer to inner. Read more
fn write_array_ret<T, F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> (Self::Output, T) where
F: FnOnce(&mut ArrayWriter<'_>) -> T,
fn write_array_ret<T, F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> (Self::Output, T) where
F: FnOnce(&mut ArrayWriter<'_>) -> T,
Write a nested array using the given closure that receives an array builder. Tags are from outer to inner. Read more
fn write_dict<F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> Self::Output where
F: FnOnce(&mut DictWriter<'_>),
fn write_dict<F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> Self::Output where
F: FnOnce(&mut DictWriter<'_>),
Write a nested dict using the given closure that receives a dict builder. Tags are from outer to inner. Read more
fn write_dict_ret<T, F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> (Self::Output, T) where
F: FnOnce(&mut DictWriter<'_>) -> T,
fn write_dict_ret<T, F>(
self,
tags: impl IntoIterator<Item = u64>,
f: F
) -> (Self::Output, T) where
F: FnOnce(&mut DictWriter<'_>) -> T,
Write a nested dict using the given closure that receives a dict builder. Tags are from outer to inner. Read more
Interpret the given bytes as a single CBOR item and write it to this builder,
canonicalising its contents like CborOwned::canonical() Read more
Assume that the given bytes are a well-formed single CBOR item and write it to this builder. Read more
Write the given CBOR item