Skip to main content

PushPeer

Struct PushPeer 

Source
pub struct PushPeer<Prev: Pusher> { /* private fields */ }
Available on crate feature ovpn only.

Implementations§

Source§

impl<Prev: Pusher> PushPeer<Prev>

Source

pub fn new(prev: Prev) -> Self

Source

pub fn end_nested(self) -> Prev

Source

pub fn push_id(self, value: u32) -> Self

The unique ID of the peer in the device context. To be used to identify peers during operations for a specific device. Also used to match packets received from this peer.

Source

pub fn push_remote_ipv4(self, value: Ipv4Addr) -> Self

The remote IPv4 address of the peer

Source

pub fn push_remote_ipv6(self, value: &[u8]) -> Self

The remote IPv6 address of the peer

Source

pub fn push_remote_ipv6_scope_id(self, value: u32) -> Self

The scope id of the remote IPv6 address of the peer (RFC2553)

Source

pub fn push_remote_port(self, value: u16) -> Self

The remote port of the peer

Source

pub fn push_socket(self, value: u32) -> Self

The socket to be used to communicate with the peer

Source

pub fn push_socket_netnsid(self, value: i32) -> Self

The ID of the netns the socket assigned to this peer lives in

Source

pub fn push_vpn_ipv4(self, value: Ipv4Addr) -> Self

The IPv4 address assigned to the peer by the server

Source

pub fn push_vpn_ipv6(self, value: &[u8]) -> Self

The IPv6 address assigned to the peer by the server

Source

pub fn push_local_ipv4(self, value: Ipv4Addr) -> Self

The local IPv4 to be used to send packets to the peer (UDP only)

Source

pub fn push_local_ipv6(self, value: &[u8]) -> Self

The local IPv6 to be used to send packets to the peer (UDP only)

Source

pub fn push_local_port(self, value: u16) -> Self

The local port to be used to send packets to the peer (UDP only)

Source

pub fn push_keepalive_interval(self, value: u32) -> Self

The number of seconds after which a keep alive message is sent to the peer

Source

pub fn push_keepalive_timeout(self, value: u32) -> Self

The number of seconds from the last activity after which the peer is assumed dead

Source

pub fn push_del_reason(self, value: u32) -> Self

The reason why a peer was deleted

Associated type: DelPeerReason (enum)

Source

pub fn push_vpn_rx_bytes(self, value: u32) -> Self

Number of bytes received over the tunnel

Source

pub fn push_vpn_tx_bytes(self, value: u32) -> Self

Number of bytes transmitted over the tunnel

Source

pub fn push_vpn_rx_packets(self, value: u32) -> Self

Number of packets received over the tunnel

Source

pub fn push_vpn_tx_packets(self, value: u32) -> Self

Number of packets transmitted over the tunnel

Number of bytes received at the transport level

Number of bytes transmitted at the transport level

Number of packets received at the transport level

Number of packets transmitted at the transport level

Source

pub fn push_tx_id(self, value: u32) -> Self

The ID value used when transmitting packets to this peer. This way outgoing packets can have a different ID than incoming ones. Useful in multipeer-to-multipeer connections, where each peer will advertise the tx-id to be used on the link.

Trait Implementations§

Source§

impl<Prev: Pusher> Drop for PushPeer<Prev>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<Prev: Pusher> Pusher for PushPeer<Prev>

Source§

fn as_vec_mut(&mut self) -> &mut Vec<u8>

Source§

fn as_vec(&self) -> &Vec<u8>

Source§

fn as_rec(&self) -> &Vec<u8>

👎Deprecated:

Use .as_vec() instead (rec -> vec)

Source§

fn as_rec_mut(&mut self) -> &mut Vec<u8>

👎Deprecated:

Use .as_vec_mut() instead (rec -> vec)

Auto Trait Implementations§

§

impl<Prev> Freeze for PushPeer<Prev>
where Prev: Freeze,

§

impl<Prev> RefUnwindSafe for PushPeer<Prev>
where Prev: RefUnwindSafe,

§

impl<Prev> Send for PushPeer<Prev>
where Prev: Send,

§

impl<Prev> Sync for PushPeer<Prev>
where Prev: Sync,

§

impl<Prev> Unpin for PushPeer<Prev>
where Prev: Unpin,

§

impl<Prev> UnsafeUnpin for PushPeer<Prev>
where Prev: UnsafeUnpin,

§

impl<Prev> UnwindSafe for PushPeer<Prev>
where Prev: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.