pub struct Config {
pub endianness: Endianness,
}Expand description
Encoding/decoding configuration
Fields§
§endianness: EndiannessDenotes endianness of encoded bytes
Implementations§
Source§impl Config
impl Config
Sourcepub const fn new_default() -> Self
pub const fn new_default() -> Self
Returns default configuration
Sourcepub async fn encode<E: Encode + ?Sized>(&self, value: &E) -> Vec<u8> ⓘ
pub async fn encode<E: Encode + ?Sized>(&self, value: &E) -> Vec<u8> ⓘ
Encodes a value in a Vec
Sourcepub async fn encode_to<E: Encode + ?Sized, W: Write + Unpin + Send>(
&self,
value: &E,
writer: W,
) -> Result<usize>
pub async fn encode_to<E: Encode + ?Sized, W: Write + Unpin + Send>( &self, value: &E, writer: W, ) -> Result<usize>
Writes encoded byte array to writer and returns the number of bytes written
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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