pub struct Padding { /* private fields */ }Expand description
Trojan padding frame used to disguise connection metadata.
Implementations§
Source§impl Padding
impl Padding
Sourcepub fn new(start: u16, end: u16) -> Self
pub fn new(start: u16, end: u16) -> Self
Create a padding frame with a random length in start..end.
Sourcepub async fn read_from<R>(stream: &mut R) -> Result<Self>
pub async fn read_from<R>(stream: &mut R) -> Result<Self>
Read a padding frame from the stream.
Sourcepub async fn write_to<W>(&self, w: &mut W) -> Result<()>where
W: AsyncWrite + Unpin,
pub async fn write_to<W>(&self, w: &mut W) -> Result<()>where
W: AsyncWrite + Unpin,
Write this padding frame to the stream.
pub fn write_to_buf<B: BufMut>(&self, buf: &mut B)
pub fn serialized_len(&self) -> usize
pub fn rand_buf(&self) -> Vec<u8> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Padding
impl RefUnwindSafe for Padding
impl Send for Padding
impl Sync for Padding
impl Unpin for Padding
impl UnsafeUnpin for Padding
impl UnwindSafe for Padding
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