-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vincenzo Palazzo <[email protected]>
- Loading branch information
1 parent
d2dcf7f
commit 42d23c6
Showing
6 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -3,10 +3,14 @@ | |
//! Author: Vincenzo Palazzo <[email protected]>. | ||
use std::vec::Vec; | ||
|
||
#[cfg(feature = "pyo3")] | ||
use pyo3::pyclass; | ||
|
||
use crate::core::{FromWire, ToWire}; | ||
|
||
// FIXME: rename to bitvector :) | ||
#[derive(Clone, Debug)] | ||
#[cfg_attr(feature = "pyo3", pyclass)] | ||
#[derive(Clone, Debug, Default)] | ||
pub struct BitFlag { | ||
pub len: u16, | ||
inner: Vec<u8>, | ||
|
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
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 |
---|---|---|
|
@@ -30,13 +30,17 @@ | |
//! makes parsing faster and the data smaller than in comparable text based protocols. | ||
//! | ||
//! Author: Vincenzo Palazzo <[email protected]> | ||
#[cfg(feature = "pyo3")] | ||
use pyo3::pyclass; | ||
|
||
use crate::core::{FromWire, ToWire}; | ||
use crate::types::BigSize; | ||
|
||
/// Stream - A `tlv_stream` is a series of (possibly zero) `tlv_record`s, represented as the | ||
/// concatenation of the encoded `tlv_record`s. When used to extend existing | ||
/// messages, a `tlv_stream` is typically placed after all currently defined fields. | ||
#[derive(Clone)] | ||
#[cfg_attr(feature = "pyo3", pyclass)] | ||
#[derive(Clone, Default)] | ||
pub struct Stream { | ||
pub records: Vec<Record>, | ||
} | ||
|
@@ -78,6 +82,7 @@ impl FromWire for Stream { | |
/// * [`bigsize`: `type`] | ||
/// * [`bigsize`: `length`] | ||
/// * [`length`: `value`] | ||
#[cfg_attr(feature = "pyo3", pyclass)] | ||
#[derive(Clone)] | ||
pub struct Record { | ||
/// The `type` is encoded using the BigSize format. It functions as a | ||
|