pub struct NetPattern {
pub host: String,
pub port: Option<u16>,
pub protocol: NetProtocol,
}Expand description
Network access pattern
Fields§
§host: StringHost pattern (e.g., “api.example.com”, “*.github.com”)
port: Option<u16>Port (None = any port)
protocol: NetProtocolProtocol
Implementations§
Source§impl NetPattern
impl NetPattern
Sourcepub fn https_port(host: impl Into<String>, port: u16) -> Self
pub fn https_port(host: impl Into<String>, port: u16) -> Self
Create HTTPS pattern with specific port
Sourcepub fn contains(&self, other: &NetPattern) -> bool
pub fn contains(&self, other: &NetPattern) -> bool
Check if this pattern contains/covers another pattern
Trait Implementations§
Source§impl Clone for NetPattern
impl Clone for NetPattern
Source§fn clone(&self) -> NetPattern
fn clone(&self) -> NetPattern
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 Debug for NetPattern
impl Debug for NetPattern
Source§impl<'de> Deserialize<'de> for NetPattern
impl<'de> Deserialize<'de> for NetPattern
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 PartialEq for NetPattern
impl PartialEq for NetPattern
Source§impl Serialize for NetPattern
impl Serialize for NetPattern
impl Eq for NetPattern
impl StructuralPartialEq for NetPattern
Auto Trait Implementations§
impl Freeze for NetPattern
impl RefUnwindSafe for NetPattern
impl Send for NetPattern
impl Sync for NetPattern
impl Unpin for NetPattern
impl UnwindSafe for NetPattern
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