MCPcopy Create free account
hub / github.com/biblius/validify / validate_ip

Function validate_ip

validify/src/validation/ip.rs:24–29  ·  view source on GitHub ↗
(val: T)

Source from the content-addressed store, hash-verified

22/// Validates whether the given string is an IP
23#[must_use]
24pub fn validate_ip<T>(val: T) -> bool
25where
26 T: AsRef<str>,
27{
28 IpAddr::from_str(val.as_ref()).is_ok()
29}
30
31#[cfg(test)]
32mod tests {

Callers 1

validate_domain_partFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected