This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
2 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,38 @@ | ||
use std::fmt::Display; | ||
|
||
#[derive(Debug)] | ||
pub(super) enum ResetCode { | ||
Unspecified, | ||
} | ||
|
||
impl From<u32> for ResetCode { | ||
fn from(value: u32) -> Self { | ||
match value { | ||
0 => Self::Unspecified, | ||
|
||
_ => Self::Unspecified, | ||
} | ||
} | ||
} | ||
|
||
impl From<ResetCode> for u32 { | ||
fn from(value: ResetCode) -> Self { | ||
match value { | ||
ResetCode::Unspecified => 0, | ||
} | ||
} | ||
} | ||
|
||
impl From<ResetCode> for quinn_proto::VarInt { | ||
fn from(value: ResetCode) -> Self { | ||
quinn_proto::VarInt::from_u32(value.into()) | ||
} | ||
} | ||
|
||
impl Display for ResetCode { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
f.write_str(match self { | ||
ResetCode::Unspecified => "unspecified or unknown", | ||
}) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod codes; | ||
mod systems; | ||
|
||
pub(crate) use systems::*; | ||
|
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