Fields
buffer: Vec<u8>
Implementations
sourceimpl Encoder
impl Encoder
pub fn new() -> Encoder
sourcepub fn encode<T: Encode>(&mut self, x: T) -> Result<&mut Self, Error>
pub fn encode<T: Encode>(&mut self, x: T) -> Result<&mut Self, Error>
Encode any type that implements Encode
.
pub fn u8(&mut self, x: u8) -> Result<&mut Self, Error>
pub fn bytes(&mut self, x: &[u8]) -> Result<&mut Self, Error>
pub fn byte_array(&mut self, arr: &[u8]) -> Result<&mut Self, Error>
pub fn integer(&mut self, i: isize) -> &mut Self
pub fn char(&mut self, c: char) -> &mut Self
pub fn string(&mut self, s: &str) -> &mut Self
pub fn utf8(&mut self, s: &str) -> Result<&mut Self, Error>
pub fn word(&mut self, c: usize) -> &mut Self
pub fn encode_list_with(
&mut self,
list: Vec<u8>,
encoder_func: for<'r> fn(_: u8, _: &'r mut Encoder) -> Result<(), Error>
) -> Result<&mut Self, Error>
pub fn bits(&mut self, num_bits: i64, val: u8) -> &mut Self
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more