pub struct TwoRttRelay { /* private fields */ }Expand description
No retries or network I/O. Every preparation is spent before randomness or encryption; failure closes this attempt instead of making it reusable.
Implementations§
Source§impl TwoRttRelay
impl TwoRttRelay
pub fn new( room: RoomInputs, room_key: u64, endpoint: SocketAddrV4, epoch: RelayEpoch, deadline_ms: u64, ) -> Result<Self>
pub fn room(&self) -> &RoomInputs
pub fn is_ready(&self) -> bool
pub fn random_bytes_needed(&self) -> Result<usize>
pub fn continuation_random_bytes_needed( &self, header_timestamp: u32, body_timestamp: u32, ) -> Result<usize>
pub fn prepare_initial( &mut self, epoch: RelayEpoch, now_ms: u64, random: &[u8], ) -> Result<Vec<u8>>
pub fn prepare_continuation( &mut self, epoch: RelayEpoch, now_ms: u64, header_timestamp: u32, body_timestamp: u32, random: &[u8], ) -> Result<Vec<u8>>
pub fn receive( &mut self, packet: &[u8], source: SocketAddrV4, epoch: RelayEpoch, now_ms: u64, ) -> Result<RelayProgress>
pub fn close(&mut self)
Auto Trait Implementations§
impl Freeze for TwoRttRelay
impl RefUnwindSafe for TwoRttRelay
impl Send for TwoRttRelay
impl Sync for TwoRttRelay
impl Unpin for TwoRttRelay
impl UnsafeUnpin for TwoRttRelay
impl UnwindSafe for TwoRttRelay
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