pub struct EncodingManager { /* private fields */ }Expand description
High-level encoding manager
Implementations§
Source§impl EncodingManager
impl EncodingManager
Sourcepub fn new(config: EncodingConfig) -> Self
pub fn new(config: EncodingConfig) -> Self
Create a new encoding manager
Sourcepub fn encode<T: EncodableValue>(
&mut self,
value: T,
tag: ApplicationTag,
) -> Result<Vec<u8>>
pub fn encode<T: EncodableValue>( &mut self, value: T, tag: ApplicationTag, ) -> Result<Vec<u8>>
Encode a value with full management features
Sourcepub fn decode<T>(
&mut self,
data: &[u8],
decoder: impl Fn(&[u8]) -> Result<(T, usize)>,
) -> Result<T>
pub fn decode<T>( &mut self, data: &[u8], decoder: impl Fn(&[u8]) -> Result<(T, usize)>, ) -> Result<T>
Decode a value with full management features
Sourcepub fn get_stats(&self) -> Option<&EncodingStatistics>
pub fn get_stats(&self) -> Option<&EncodingStatistics>
Get performance statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset all statistics
Trait Implementations§
Source§impl Debug for EncodingManager
impl Debug for EncodingManager
Auto Trait Implementations§
impl Freeze for EncodingManager
impl RefUnwindSafe for EncodingManager
impl Send for EncodingManager
impl Sync for EncodingManager
impl Unpin for EncodingManager
impl UnsafeUnpin for EncodingManager
impl UnwindSafe for EncodingManager
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