Skip to content

Commit

Permalink
finish framing_sv2 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
plebhash committed Apr 28, 2024
1 parent 57be260 commit 13774bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions protocols/v2/framing-sv2/src/framing2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ impl<T, B> Default for Sv2Frame<T, B> {
}

/// Abstraction for a Noise Frame
/// In practice, it is only used as the alias `HandShakeFrame`
/// Contains only a `Slice` payload
#[derive(Debug)]
pub struct NoiseFrame {
payload: Slice,
}

/// todo
/// The only practical usage of `NoiseFrame`
pub type HandShakeFrame = NoiseFrame;

impl NoiseFrame {
Expand Down Expand Up @@ -340,7 +342,8 @@ fn update_extension_type(extension_type: u16, channel_msg: bool) -> u16 {
}
}

/// todo
/// A wrapper to be used in a context we need a generic reference to a frame
/// but it doesn't matter which kind of frame it is (`Sv2Frame` or `HandShakeFrame`)
#[derive(Debug)]
pub enum EitherFrame<T, B> {
HandShake(HandShakeFrame),
Expand Down
2 changes: 1 addition & 1 deletion protocols/v2/framing-sv2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! This crate provides primitives for framing of SV2 binary messages.
//!
//! The message framing is outlined below:
//! The message framing is outlined below ([according to SV2 specs](https://stratumprotocol.org/specification/03-Protocol-Overview/#32-framing)):
//!
//! | Protocol Type | Byte Length | Description |
//! |----------------|-------------|-------------|
Expand Down

0 comments on commit 13774bf

Please sign in to comment.