pub struct FrameCodec { /* private fields */ }Expand description
Encodes and decodes WSCALL binary frames.
Implementations§
Source§impl FrameCodec
impl FrameCodec
Sourcepub fn with_chacha20_key(self, key: [u8; 32]) -> Self
pub fn with_chacha20_key(self, key: [u8; 32]) -> Self
Configures a ChaCha20-Poly1305 key.
Sourcepub fn with_aes256_key(self, key: [u8; 32]) -> Self
pub fn with_aes256_key(self, key: [u8; 32]) -> Self
Configures an AES256-GCM key.
Sourcepub fn encode(&self, packet: &PacketEnvelope) -> Result<Vec<u8>, ProtocolError>
pub fn encode(&self, packet: &PacketEnvelope) -> Result<Vec<u8>, ProtocolError>
Encodes an envelope into a binary WSCALL frame.
Sourcepub fn decode(&self, frame: &[u8]) -> Result<PacketEnvelope, ProtocolError>
pub fn decode(&self, frame: &[u8]) -> Result<PacketEnvelope, ProtocolError>
Decodes a binary WSCALL frame back into an envelope.
Trait Implementations§
Source§impl Clone for FrameCodec
impl Clone for FrameCodec
Source§fn clone(&self) -> FrameCodec
fn clone(&self) -> FrameCodec
Returns a duplicate 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 FrameCodec
impl Debug for FrameCodec
Source§impl Default for FrameCodec
impl Default for FrameCodec
Source§fn default() -> FrameCodec
fn default() -> FrameCodec
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FrameCodec
impl RefUnwindSafe for FrameCodec
impl Send for FrameCodec
impl Sync for FrameCodec
impl Unpin for FrameCodec
impl UnsafeUnpin for FrameCodec
impl UnwindSafe for FrameCodec
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