pub struct BinarySerializer { /* private fields */ }Implementations§
Source§impl BinarySerializer
impl BinarySerializer
Sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Creates a new BinarySerializer with the specified configuration.
Sourcepub fn output(self) -> BytesMut
pub fn output(self) -> BytesMut
Consumes the serializer and returns the serialized output as BytesMut.
Sourcepub fn container_length(&mut self, length: usize)
pub fn container_length(&mut self, length: usize)
Writes the length of a container (e.g., sequence, string) to the output buffer based on the configured endianness and container length strategy.
pub fn bool(&mut self, v: bool) -> Result<()>
pub fn i8(&mut self, v: i8) -> Result<()>
pub fn i16(&mut self, v: i16) -> Result<()>
pub fn i32(&mut self, v: i32) -> Result<()>
pub fn i64(&mut self, v: i64) -> Result<()>
pub fn i128(&mut self, v: i128) -> Result<()>
pub fn u8(&mut self, v: u8) -> Result<()>
pub fn u16(&mut self, v: u16) -> Result<()>
pub fn u32(&mut self, v: u32) -> Result<()>
pub fn u64(&mut self, v: u64) -> Result<()>
pub fn u128(&mut self, v: u128) -> Result<()>
pub fn f32(&mut self, v: f32) -> Result<()>
pub fn f64(&mut self, v: f64) -> Result<()>
pub fn char(&mut self, v: char) -> Result<()>
pub fn str(&mut self, v: &str) -> Result<()>
pub fn bytes(&mut self, v: &[u8]) -> Result<()>
Trait Implementations§
Source§impl Debug for BinarySerializer
impl Debug for BinarySerializer
Source§impl Default for BinarySerializer
impl Default for BinarySerializer
Source§fn default() -> BinarySerializer
fn default() -> BinarySerializer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BinarySerializer
impl RefUnwindSafe for BinarySerializer
impl Send for BinarySerializer
impl Sync for BinarySerializer
impl Unpin for BinarySerializer
impl UnwindSafe for BinarySerializer
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