pub struct GapClient { /* private fields */ }Expand description
Stateful GAP client.
Maintains an outbound rtp_sequence counter and an inbound replay window,
both keyed by media_source_id.
The client observes the current group epoch on every GapClient::send
or GapClient::accept call and automatically clears its replay window
when the epoch advances. Callers may also drive a reset explicitly via
GapClient::reset.
Implementations§
Source§impl GapClient
impl GapClient
Sourcepub fn send<S: Sealer>(
&mut self,
node: &mut GroupNode,
seal: &mut S,
target: MemberId,
media_source_id: u32,
rtp_timestamp: u64,
opus: Vec<u8>,
) -> Result<OutboundFrame, GapError>
pub fn send<S: Sealer>( &mut self, node: &mut GroupNode, seal: &mut S, target: MemberId, media_source_id: u32, rtp_timestamp: u64, opus: Vec<u8>, ) -> Result<OutboundFrame, GapError>
Sends an Opus frame. key_phase is taken from node.current_epoch.
Uses the O profile (no R / A — voice is not reliable, GAP §7).
The wire rtp_sequence is clamped to the 16-bit RTP range; on
overflow it wraps from 0xFFFF back to 0x0000.
Sourcepub fn accept(
&mut self,
plaintext: &[u8],
current_epoch: u64,
) -> Result<GapAccept, GapError>
pub fn accept( &mut self, plaintext: &[u8], current_epoch: u64, ) -> Result<GapAccept, GapError>
Accepts a plaintext payload delivered by the GBP layer.
Returns GapAccept::New for fresh frames, GapAccept::Late for
replays that the spec allows to drop, or GapError::EpochStale when
key_phase does not match the current epoch.
Sourcepub fn sync_epoch(&mut self, epoch: u64)
pub fn sync_epoch(&mut self, epoch: u64)
Synchronises the client’s view of the group epoch and resets the
outbound counters and replay window when the epoch has advanced.
Called automatically by GapClient::send and GapClient::accept.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GapClient
impl RefUnwindSafe for GapClient
impl Send for GapClient
impl Sync for GapClient
impl Unpin for GapClient
impl UnsafeUnpin for GapClient
impl UnwindSafe for GapClient
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
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more