Struct bitcoin_service::Service
source · pub struct Service {
pub base: NetAddr,
pub port: u16,
}
Expand description
| A combination of a network address (CNetAddr) | and a (TCP) port |
Fields§
§base: NetAddr
§port: u16
| host order |
Implementations§
source§impl Service
impl Service
pub fn is_relayable(&self) -> bool
pub fn serialize<Stream>(&self, s: &mut Stream)
pub fn unserialize<Stream>(&mut self, s: &mut Stream)
pub fn serialize_v1array(&self, arr: &mut [u8; 16])
pub fn serialize_v1stream<Stream>(&self, s: &mut Stream)
pub fn serialize_v2stream<Stream>(&self, s: &mut Stream)
pub fn unserialize_v1array(&mut self, arr: &mut [u8; 16])
pub fn unserialize_v1stream<Stream>(&mut self, s: &mut Stream)
pub fn unserialize_v2stream<Stream>(&mut self, s: &mut Stream)
pub fn get_bip155network(&self) -> BIP155Network
pub fn set_net_from_bip155network( &mut self, possible_bip155_net: u8, address_size: usize ) -> bool
pub fn setip(&mut self, ip_in: &NetAddr)
pub fn set_legacy_ipv6(&mut self, ipv6: &[u8])
pub fn set_internal(&mut self, name: &str) -> bool
pub fn set_special(&mut self, addr: &String) -> bool
pub fn set_tor(&mut self, addr: &String) -> bool
pub fn seti2p(&mut self, addr: &String) -> bool
pub fn is_bind_any(&self) -> bool
pub fn is_ipv4(&self) -> bool
pub fn is_ipv6(&self) -> bool
pub fn isrfc1918(&self) -> bool
pub fn isrfc2544(&self) -> bool
pub fn isrfc3927(&self) -> bool
pub fn isrfc6598(&self) -> bool
pub fn isrfc5737(&self) -> bool
pub fn isrfc3849(&self) -> bool
pub fn isrfc3964(&self) -> bool
pub fn isrfc6052(&self) -> bool
pub fn isrfc4380(&self) -> bool
pub fn isrfc4862(&self) -> bool
pub fn isrfc4193(&self) -> bool
pub fn isrfc6145(&self) -> bool
pub fn isrfc4843(&self) -> bool
pub fn isrfc7343(&self) -> bool
pub fn is_he_net(&self) -> bool
pub fn is_tor(&self) -> bool
pub fn isi2p(&self) -> bool
pub fn iscjdns(&self) -> bool
pub fn is_local(&self) -> bool
pub fn is_valid(&self) -> bool
pub fn is_routable(&self) -> bool
pub fn is_internal(&self) -> bool
pub fn is_addr_v1compatible(&self) -> bool
pub fn get_network(&self) -> Network
pub fn get_in_addr(&self, pipv_4addr: *mut InAddr) -> bool
pub fn get_in_6addr(&self, pipv_6addr: *mut In6Addr) -> bool
pub fn has_linked_ipv4(&self) -> bool
pub fn get_linked_ipv4(&self) -> u32
pub fn get_net_class(&self) -> Network
pub fn get_mappedas(&self, asmap: &Vec<bool>) -> u32
pub fn get_group(&self, asmap: &Vec<bool>) -> Vec<u8>
pub fn get_addr_bytes(&self) -> Vec<u8>
pub fn get_hash(&self) -> u64
pub fn get_reachability_from(&self, paddr_partner: *const NetAddr) -> i32
source§impl Service
impl Service
pub fn new_from_net_addr(cip: &NetAddr, port_in: u16) -> Self
pub fn new_from_ip4(ipv4_addr: &InAddr, port_in: u16) -> Self
pub fn new_from_ip6(ipv6_addr: &In6Addr, port_in: u16) -> Self
pub fn set_sock_addr(&mut self, paddr: *const SocketAddr) -> bool
pub fn get_port(&self) -> u16
sourcepub fn get_sock_addr(
&self,
paddr: *mut SocketAddr,
addrlen: *mut socklen_t
) -> bool
pub fn get_sock_addr( &self, paddr: *mut SocketAddr, addrlen: *mut socklen_t ) -> bool
| Obtain the IPv4/6 socket address this | represents. | | ———– | @param[out] paddr | | The obtained socket address. | ––––– | @param[in,out] addrlen | | The size, in bytes, of the address structure | pointed to by paddr. The value that’s | pointed to by this parameter might change | after calling this function if the size | of the corresponding address structure | changed. | | ———– | @return | | Whether or not the operation was successful. |
sourcepub fn get_key(&self) -> Vec<u8>
pub fn get_key(&self) -> Vec<u8>
| @return | | An identifier unique to this service’s | address and port number. |
pub fn to_string_port(&self) -> String
pub fn to_string_ip_port(&self) -> String
pub fn to_string(&self) -> String
Trait Implementations§
source§impl<'de> Deserialize<'de> for Service
impl<'de> Deserialize<'de> for Service
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Service
impl Ord for Service
source§impl PartialEq<Service> for Service
impl PartialEq<Service> for Service
source§impl PartialOrd<Service> for Service
impl PartialOrd<Service> for Service
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Service
Auto Trait Implementations§
impl RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl Unpin for Service
impl UnwindSafe for Service
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more