io/open
lib/io/open.vklib/io/open.vk
Unified URI SchemeMux opening mem://, file://, tcp://, tls://, http://, and https:// streams.
default-mux = fn [] io/SchemeMux
Opens a SchemeMux pre-registered with mem://, file://, tcp://, tls://, http://, and https://.
Executable Example
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 [uri str] io/Stream
Convenience wrapper that opens any mem://, file://, tcp://, tls://, http://, or https:// URI as an io/Stream.
Executable Example
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 ]