pub struct LocoClientSecureLayer {
pub read_buffer: VecDeque<u8>,
pub write_buffer: VecDeque<u8>,
/* private fields */
}Expand description
IO-free client secure layer
Fields§
§read_buffer: VecDeque<u8>Read buffer for layer
write_buffer: VecDeque<u8>Write buffer for layer
Implementations§
Source§impl LocoClientSecureLayer
impl LocoClientSecureLayer
Sourcepub fn new(encrypt_key: [u8; 16]) -> Self
pub fn new(encrypt_key: [u8; 16]) -> Self
Create new LocoClientSecureLayer with given encrypt key
pub const fn read_state(&self) -> &ReadState
Sourcepub fn handshake(&mut self, key: &RsaPublicKey)
pub fn handshake(&mut self, key: &RsaPublicKey)
Write handshake packet to LocoClientSecureLayer::write_buffer using given public key
Sourcepub fn read(&mut self) -> Option<SecurePacket<Box<[u8]>>>
pub fn read(&mut self) -> Option<SecurePacket<Box<[u8]>>>
Try to read single SecurePacket from LocoClientSecureLayer::read_buffer
Sourcepub fn send(&mut self, packet: SecurePacket<impl AsRef<[u8]>>)
pub fn send(&mut self, packet: SecurePacket<impl AsRef<[u8]>>)
Write single SecurePacket to LocoClientSecureLayer::write_buffer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocoClientSecureLayer
impl RefUnwindSafe for LocoClientSecureLayer
impl Send for LocoClientSecureLayer
impl Sync for LocoClientSecureLayer
impl Unpin for LocoClientSecureLayer
impl UnwindSafe for LocoClientSecureLayer
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