[−][src]Struct dtn7::core::peer::DtnPeer
Fields
eid: EndpointID
addr: IpAddr
con_type: PeerType
cla_list: Vec<(String, Option<u16>)>
last_contact: u64
Methods
impl DtnPeer
[src]
pub fn new(
eid: EndpointID,
addr: IpAddr,
con_type: PeerType,
cla_list: Vec<(String, Option<u16>)>
) -> DtnPeer
[src]
eid: EndpointID,
addr: IpAddr,
con_type: PeerType,
cla_list: Vec<(String, Option<u16>)>
) -> DtnPeer
pub fn touch(&mut self)
[src]
Example
use std::{thread, time}; use dtn7::core::*; use dtn7::CONFIG; let mut peer = helpers::rnd_peer(); let original_time = peer.last_contact; thread::sleep(time::Duration::from_secs(1)); peer.touch(); assert!(original_time < peer.last_contact);
pub fn still_valid(&self) -> bool
[src]
Example
use std::{thread, time}; use dtn7::core::*; use dtn7::CONFIG; CONFIG.lock().unwrap().peer_timeout = 1; let mut peer = helpers::rnd_peer(); assert_eq!(peer.still_valid(), true); thread::sleep(time::Duration::from_secs(2)); assert_eq!(peer.still_valid(), false);
pub fn get_node_name(&self) -> String
[src]
pub fn get_first_cla(&self) -> Option<ClaSender>
[src]
Trait Implementations
impl Clone for DtnPeer
[src]
impl Debug for DtnPeer
[src]
impl Serialize for DtnPeer
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for DtnPeer
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for DtnPeer
impl Sync for DtnPeer
impl Unpin for DtnPeer
impl UnwindSafe for DtnPeer
impl RefUnwindSafe for DtnPeer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,