pub struct DataChannel { /* private fields */ }Expand description
Data channel encryption/decryption handler
Implementations§
Source§impl DataChannel
impl DataChannel
Sourcepub fn new(
key_id: KeyId,
encrypt_key: DataChannelKey,
decrypt_key: DataChannelKey,
use_v2: bool,
peer_id: Option<u32>,
) -> Self
pub fn new( key_id: KeyId, encrypt_key: DataChannelKey, decrypt_key: DataChannelKey, use_v2: bool, peer_id: Option<u32>, ) -> Self
Create a new data channel
Sourcepub fn encrypt(&mut self, ip_packet: &[u8]) -> Result<DataPacket>
pub fn encrypt(&mut self, ip_packet: &[u8]) -> Result<DataPacket>
Encrypt an IP packet for transmission
Sourcepub fn decrypt(&mut self, packet: &DataPacket) -> Result<Bytes>
pub fn decrypt(&mut self, packet: &DataPacket) -> Result<Bytes>
Decrypt a data packet
Auto Trait Implementations§
impl Freeze for DataChannel
impl RefUnwindSafe for DataChannel
impl Send for DataChannel
impl Sync for DataChannel
impl Unpin for DataChannel
impl UnwindSafe for DataChannel
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