Struct loco_protocol::secure::client::LocoClientSecureLayer
source · 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
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 AsMut<[u8]> + 'static>)
pub fn send(&mut self, packet: SecurePacket<impl AsMut<[u8]> + 'static>)
Write single SecurePacket to LocoClientSecureLayer::write_buffer
Trait Implementations§
Auto Trait Implementations§
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