Struct bip_handshake::Extensions
[−]
[src]
pub struct Extensions { /* fields omitted */ }
Extensions
supported by either end of a handshake.
Methods
impl Extensions
[src]
fn new() -> Extensions
Create a new Extensions
with zero extensions.
fn from_bytes(bytes: &[u8]) -> IResult<&[u8], Extensions>
Create a new Extensions
by parsing the given bytes.
fn add(&mut self, extension: Extension)
Add the given extension to the list of supported Extensions
.
fn remove(&mut self, extension: Extension)
Remove the given extension from the list of supported Extensions
.
fn contains(&self, extension: Extension) -> bool
Check if a given extension is activated.
fn write_bytes<W>(&self, writer: W) -> Result<()> where
W: Write,
W: Write,
Write the Extensions
to the given writer.
fn union(&self, ext: &Extensions) -> Extensions
Create a union of the two extensions.
This is useful for getting the extensions that both clients support.
Trait Implementations
impl Copy for Extensions
[src]
impl Clone for Extensions
[src]
fn clone(&self) -> Extensions
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for Extensions
[src]
impl PartialEq for Extensions
[src]
fn eq(&self, __arg_0: &Extensions) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Extensions) -> bool
This method tests for !=
.
impl Debug for Extensions
[src]
impl From<[u8; 8]> for Extensions
[src]
fn from(bytes: [u8; 8]) -> Extensions
Performs the conversion.