-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moq-transport: MaxSubscribeId message coding
draft-06 encode/decode support for MaxSubscribeId MAX_SUBSCRIBE_ID control message - [PR 491](moq-wg/moq-transport#491) - [PR 528](moq-wg/moq-transport#528) - [§6.16](https://www.ietf.org/archive/id/draft-ietf-moq-transport-06.html#section-6.16) Just parsing for the control message so far, not wired up anywhere yet, will need error codes
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::coding::{Decode, DecodeError, Encode, EncodeError}; | ||
|
||
/// Sent by the publisher to update the max allowed subscription ID for the session. | ||
#[derive(Clone, Debug)] | ||
pub struct MaxSubscribeId { | ||
/// The max allowed subscription ID | ||
pub id: u64, | ||
} | ||
|
||
impl Decode for MaxSubscribeId { | ||
fn decode<R: bytes::Buf>(r: &mut R) -> Result<Self, DecodeError> { | ||
let id = u64::decode(r)?; | ||
|
||
Ok(Self { id }) | ||
} | ||
} | ||
|
||
impl Encode for MaxSubscribeId { | ||
fn encode<W: bytes::BufMut>(&self, w: &mut W) -> Result<(), EncodeError> { | ||
self.id.encode(w)?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters