[−][src]Struct rust_ipv8::serialization::header::Header
The struct for headers.
The mid_hash
and message_type
are Options and larger then they need to
be for easier expansion later on.
Fields
size: usize
This is a size that is hardcoded when a header is deserialized.
version: HeaderVersion
The version of the packet, 1 is dispersy and 2 is py-ipv8, could be increased to 3 for rust specific enhancements in the future
mid_hash: Option<Vec<u8>>
The hash of the master peer of a community, used to identify to which community the packets belongs
message_type: Option<u64>
Specifies the type of messsage, can be used by communities to distinguish between packets
Methods
impl Header
[src]
pub fn py_ipv8_header(mid_hash: [u8; 20], message_type: u8) -> Self
[src]
Helper function for creating a PyIPv8 compliant Header
Trait Implementations
impl PartialEq<Header> for Header
[src]
impl Debug for Header
[src]
impl Serialize for Header
[src]
makes the Header serializable.
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
All types of headers need to be serialized differently
impl<'de> Deserialize<'de> for Header
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
deserializes a Header
Auto Trait Implementations
impl Unpin for Header
impl Sync for Header
impl Send for Header
impl RefUnwindSafe for Header
impl UnwindSafe for Header
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,