veko doc
Self-Contained API Reference • Gradual Types • Capabilities • Wasm Sandbox

io/open

lib/io/open.vk

lib/io/open.vk Unified URI SchemeMux opening mem://, file://, tcp://, tls://, http://, and https:// streams.

default-mux fn caps: .net
signature
default-mux = fn [] io/SchemeMux

Opens a SchemeMux pre-registered with mem://, file://, tcp://, tls://, http://, and https://.

Executable Example
veko
use [io, iopen = io/open]
mux = iopen/default-mux
mut s = io/mux-open mux 'mem://hello-open'
got = io/read-all mut s
if (bytes/to-str got) != 'hello-open' [ err 'io/open mem' ] else [ .ok ]
open fn
signature
open = fn [uri str] io/Stream

Convenience wrapper that opens any mem://, file://, tcp://, tls://, http://, or https:// URI as an io/Stream.

Executable Example
veko
use [io, iopen = io/open]
mut s = iopen/open 'mem://veko-uri'
out = io/read-all mut s
if (bytes/to-str out) != 'veko-uri' [ err 'io/open' ] else [ .ok ]