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-
Optional members. - when serializing
unionshapes (they can only have one member set). - when serializing a
mapshape.
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,
§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