[−][src]Struct cbor_data::ArrayWriter
Builder for an array value, used by write_array_ret()
.
see trait Encoder
for usage examples
Implementations
impl<'a> ArrayWriter<'a>
[src]
pub fn set_max_definite_size(&mut self, size: Option<u64>)
[src]
Configure the limit above which indefinite size encoding will be used.
The default is 255, which is the largest size up to which definite size is at least as
compact as indefinite size. Set to 23 to avoid moving bytes around when finishing the array.
Set to None
to always use indefinite size encoding.
Trait Implementations
impl<'a> Writer for ArrayWriter<'a>
[src]
type Output = Self
pub fn bytes<T>(&mut self, f: impl FnOnce(&mut Vec<u8>) -> T) -> T
[src]
pub fn to_output(self) -> Self::Output
[src]
pub fn max_definite(&self) -> Option<u64>
[src]
pub fn write_pos(self, value: u64, tag: Option<u64>) -> Self::Output
[src]
pub fn write_neg(self, value: u64, tag: Option<u64>) -> Self::Output
[src]
pub fn write_bytes(self, value: &[u8], tag: Option<u64>) -> Self::Output
[src]
pub fn write_str(self, value: &str, tag: Option<u64>) -> Self::Output
[src]
pub fn write_bool(self, value: bool, tag: Option<u64>) -> Self::Output
[src]
pub fn write_null(self, tag: Option<u64>) -> Self::Output
[src]
pub fn write_undefined(self, tag: Option<u64>) -> Self::Output
[src]
pub fn write_lit(self, value: Literal, tag: Option<u64>) -> Self::Output
[src]
pub fn write_array<F>(self, tag: Option<u64>, f: F) -> Self::Output where
F: FnOnce(&mut ArrayWriter<'_>),
[src]
F: FnOnce(&mut ArrayWriter<'_>),
pub fn write_array_ret<T, F>(self, tag: Option<u64>, f: F) -> (Self::Output, T) where
F: FnOnce(&mut ArrayWriter<'_>) -> T,
[src]
F: FnOnce(&mut ArrayWriter<'_>) -> T,
pub fn write_dict<F>(self, tag: Option<u64>, f: F) -> Self::Output where
F: FnOnce(&mut DictWriter<'_>),
[src]
F: FnOnce(&mut DictWriter<'_>),
pub fn write_dict_ret<T, F>(self, tag: Option<u64>, f: F) -> (Self::Output, T) where
F: FnOnce(&mut DictWriter<'_>) -> T,
[src]
F: FnOnce(&mut DictWriter<'_>) -> T,
pub fn write_canonical(self, bytes: &[u8]) -> Option<Self::Output>
[src]
pub fn write_trusting(self, bytes: &[u8]) -> Self::Output
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for ArrayWriter<'a>
[src]
impl<'a> Send for ArrayWriter<'a>
[src]
impl<'a> Sync for ArrayWriter<'a>
[src]
impl<'a> Unpin for ArrayWriter<'a>
[src]
impl<'a> !UnwindSafe for ArrayWriter<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,