Struct aws_smithy_cbor::encode::Encoder
source · pub struct Encoder { /* private fields */ }
Implementations§
source§impl Encoder
impl Encoder
pub fn new(writer: Vec<u8>) -> Self
pub fn begin_map(&mut self) -> &mut Self
pub fn str(&mut self, x: &str) -> &mut Self
pub fn boolean(&mut self, x: bool) -> &mut Self
pub fn byte(&mut self, x: i8) -> &mut Self
pub fn short(&mut self, x: i16) -> &mut Self
pub fn integer(&mut self, x: i32) -> &mut Self
pub fn long(&mut self, x: i64) -> &mut Self
pub fn float(&mut self, x: f32) -> &mut Self
pub fn double(&mut self, x: f64) -> &mut Self
pub fn null(&mut self) -> &mut Self
pub fn end(&mut self) -> &mut Self
pub fn blob(&mut self, x: &Blob) -> &mut Self
sourcepub fn map(&mut self, len: usize) -> &mut Self
pub fn map(&mut self, len: usize) -> &mut Self
Writes a fixed length map of given length. Used when we know the size in advance, i.e.:
- when a struct has all non-
Option
al members. - when serializing
union
shapes (they can only have one member set). - when serializing a
map
shape.
pub fn timestamp(&mut self, x: &DateTime) -> &mut Self
pub fn into_writer(self) -> Vec<u8> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more