[][src]Struct hypercore_protocol::schema::Have

pub struct Have {
    pub start: u64,
    pub length: Option<u64>,
    pub bitfield: Option<Vec<u8>>,
    pub ack: Option<bool>,
}

type=3, what do we have?

Fields

start: u64length: Option<u64>

defaults to 1

bitfield: Option<Vec<u8>>ack: Option<bool>

when true, this Have message is an acknowledgement

Implementations

impl Have[src]

pub fn length(&self) -> u64[src]

Returns the value of length, or the default value if length is unset.

pub fn bitfield(&self) -> &[u8][src]

Returns the value of bitfield, or the default value if bitfield is unset.

pub fn ack(&self) -> bool[src]

Returns the value of ack, or the default value if ack is unset.

Trait Implementations

impl Clone for Have[src]

impl Debug for Have[src]

impl Default for Have[src]

impl Message for Have[src]

impl PartialEq<Have> for Have[src]

impl StructuralPartialEq for Have[src]

Auto Trait Implementations

impl RefUnwindSafe for Have

impl Send for Have

impl Sync for Have

impl Unpin for Have

impl UnwindSafe for Have

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,