pub struct AllowedIp {
pub address: Ipv4Address,
pub prefix_len: u8,
}Expand description
Allowed IP range for a peer
Fields§
§address: Ipv4AddressNetwork address
prefix_len: u8Prefix length (CIDR notation)
Implementations§
Source§impl AllowedIp
impl AllowedIp
Sourcepub fn new(address: Ipv4Address, prefix_len: u8) -> Self
pub fn new(address: Ipv4Address, prefix_len: u8) -> Self
Create new allowed IP range
Sourcepub fn matches(&self, ip: &Ipv4Address) -> bool
pub fn matches(&self, ip: &Ipv4Address) -> bool
Check if an IP address matches this allowed range
Trait Implementations§
impl Copy for AllowedIp
impl Eq for AllowedIp
impl StructuralPartialEq for AllowedIp
Auto Trait Implementations§
impl Freeze for AllowedIp
impl RefUnwindSafe for AllowedIp
impl Send for AllowedIp
impl Sync for AllowedIp
impl Unpin for AllowedIp
impl UnwindSafe for AllowedIp
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)