Struct ssh_format::Transformer
source · pub struct Transformer(/* private fields */);
Expand description
Serialize and deserialize types using the same buffer.
Implementations§
source§impl Transformer
impl Transformer
pub fn new() -> Self
sourcepub fn get_ser(&mut self) -> &mut Serializer
pub fn get_ser(&mut self) -> &mut Serializer
Get underlying serializer, can be used without reset
sourcepub fn get_buffer(&mut self) -> &mut Vec<u8>
pub fn get_buffer(&mut self) -> &mut Vec<u8>
Return the buffer so that you can read the input into it. You can also adjust the capacity and free up memory.
sourcepub fn deserialize<'a, T: Deserialize<'a>>(&'a self) -> Result<(T, &'a [u8])>
pub fn deserialize<'a, T: Deserialize<'a>>(&'a self) -> Result<(T, &'a [u8])>
NOTE that calling the serialized result cannot be deserialized directly, since it also including a 4-byte prefix representing the length of the serialized data.
Trait Implementations§
source§impl Clone for Transformer
impl Clone for Transformer
source§fn clone(&self) -> Transformer
fn clone(&self) -> Transformer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Transformer
impl Debug for Transformer
source§impl Default for Transformer
impl Default for Transformer
source§fn default() -> Transformer
fn default() -> Transformer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Transformer
impl RefUnwindSafe for Transformer
impl Send for Transformer
impl Sync for Transformer
impl Unpin for Transformer
impl UnwindSafe for Transformer
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)