pub struct PeerConfig {
pub public_key: [u8; 32],
pub allowed_ips: HashSet<Cidr>,
pub endpoint: Option<SocketAddr>,
pub preshared_key: Option<[u8; 32]>,
pub persistent_keepalive: Option<Duration>,
}
Expand description
Configuration for a peer.
Fields§
§public_key: [u8; 32]
§allowed_ips: HashSet<Cidr>
§endpoint: Option<SocketAddr>
§persistent_keepalive: Option<Duration>
Implementations§
Source§impl PeerConfig
impl PeerConfig
pub fn public_key(self, key: [u8; 32]) -> Self
pub fn allowed_ips<T: Into<Cidr>>( self, ips: impl IntoIterator<Item = T>, ) -> Self
pub fn allowed_ip<I: Into<Cidr>>(self, ip: I) -> Self
pub fn endpoint(self, endpoint: SocketAddr) -> Self
pub fn persistent_keepalive(self, interval: Duration) -> Self
Trait Implementations§
Source§impl Clone for PeerConfig
impl Clone for PeerConfig
Source§fn clone(&self) -> PeerConfig
fn clone(&self) -> PeerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for PeerConfig
impl Default for PeerConfig
Source§fn default() -> PeerConfig
fn default() -> PeerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PeerConfig
impl RefUnwindSafe for PeerConfig
impl Send for PeerConfig
impl Sync for PeerConfig
impl Unpin for PeerConfig
impl UnwindSafe for PeerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more