pub struct Encoder<W> { /* private fields */ }
Expand description
The actual encoder type definition
Implementations§
Source§impl<W: WriteBytesExt> Encoder<W>
impl<W: WriteBytesExt> Encoder<W>
pub fn new(w: W) -> Encoder<W>
pub fn into_writer(self) -> W
pub fn writer(&mut self) -> &mut W
pub fn u8(&mut self, x: u8) -> EncodeResult
pub fn u16(&mut self, x: u16) -> EncodeResult
pub fn u32(&mut self, x: u32) -> EncodeResult
pub fn u64(&mut self, x: u64) -> EncodeResult
pub fn i8(&mut self, x: i8) -> EncodeResult
pub fn i16(&mut self, x: i16) -> EncodeResult
pub fn i32(&mut self, x: i32) -> EncodeResult
pub fn i64(&mut self, x: i64) -> EncodeResult
pub fn int(&mut self, x: Int) -> EncodeResult
pub fn f32(&mut self, x: f32) -> EncodeResult
pub fn f64(&mut self, x: f64) -> EncodeResult
pub fn bool(&mut self, x: bool) -> EncodeResult
pub fn simple(&mut self, x: Simple) -> EncodeResult
pub fn bytes(&mut self, x: &[u8]) -> EncodeResult
Sourcepub fn bytes_iter<'r, I: Iterator<Item = &'r [u8]>>(
&mut self,
iter: I,
) -> EncodeResult
pub fn bytes_iter<'r, I: Iterator<Item = &'r [u8]>>( &mut self, iter: I, ) -> EncodeResult
Indefinite byte string encoding. (RFC 7049 section 2.2.2)
pub fn text(&mut self, x: &str) -> EncodeResult
Sourcepub fn text_iter<'r, I: Iterator<Item = &'r str>>(
&mut self,
iter: I,
) -> EncodeResult
pub fn text_iter<'r, I: Iterator<Item = &'r str>>( &mut self, iter: I, ) -> EncodeResult
Indefinite string encoding. (RFC 7049 section 2.2.2)
pub fn null(&mut self) -> EncodeResult
pub fn undefined(&mut self) -> EncodeResult
pub fn tag(&mut self, x: Tag) -> EncodeResult
pub fn array(&mut self, len: usize) -> EncodeResult
Sourcepub fn array_begin(&mut self) -> EncodeResult
pub fn array_begin(&mut self) -> EncodeResult
Indefinite array encoding. (RFC 7049 section 2.2.1)
Sourcepub fn array_end(&mut self) -> EncodeResult
pub fn array_end(&mut self) -> EncodeResult
End of indefinite array encoding. (RFC 7049 section 2.2.1)
pub fn object(&mut self, len: usize) -> EncodeResult
Sourcepub fn object_begin(&mut self) -> EncodeResult
pub fn object_begin(&mut self) -> EncodeResult
Indefinite object encoding. (RFC 7049 section 2.2.1)
Sourcepub fn object_end(&mut self) -> EncodeResult
pub fn object_end(&mut self) -> EncodeResult
End of indefinite object encoding. (RFC 7049 section 2.2.1)
Auto Trait Implementations§
impl<W> Freeze for Encoder<W>where
W: Freeze,
impl<W> RefUnwindSafe for Encoder<W>where
W: RefUnwindSafe,
impl<W> Send for Encoder<W>where
W: Send,
impl<W> Sync for Encoder<W>where
W: Sync,
impl<W> Unpin for Encoder<W>where
W: Unpin,
impl<W> UnwindSafe for Encoder<W>where
W: UnwindSafe,
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