Functional Weave
Code in Rust

net.ipv6@1.0.0

impl/rust/is_ipv6.rs

307 bytes · the Rust implementation · view raw

Imports name this capability’s declared dependencies, which fune builds next to it in your project; each one links to its page.

use super::funejson::Value;  ← the fune runtime: the JSON value the test vectors use; fune build keeps it only where a signature takes one
use super::net_ipv6_parse_ipv6::ipv6_groups;  ← parseIpv6, another function of this group · built into the same file, even by a slim install

/// True exactly when parse_ipv6 would accept the text; never panics.
pub fn is_ipv6(text: &str) -> bool {
    ipv6_groups(text).is_some()
}

pub fn fune_vector(args: &[Value]) -> Value {
    Value::Bool(is_ipv6(args[0].as_str()))
}