Skip to main content

Module source

Module source 

Source
Expand description

Byte sources and sinks.

ByteSource reads are positioned and take &self, so one handle serves every worker thread. That removes the need for a pool of handles — a checkout semaphore, worker threads, a promise per buffer — and leaves the part that earns its keep, the aligned LRU block cache, as the CachedSource decorator.

Sources compose by wrapping:

use gwseq_io::source::{CachedSource, UrlSource};

let url = "https://example.org/track.bigwig";
let src = CachedSource::new(UrlSource::open(url)?, 1 << 20, 128);

Modules§

testing
An in-memory ByteSource, for tests that want to hand a parser exact bytes rather than build a file.

Structs§

CachedSource
LocalSink
A local file opened for both directions, so the zoom pass reads back through the handle that wrote.
LocalSource
RetryPolicy
SinkSource
The read half of a LocalSink, borrowed for as long as the zoom pass needs it.
UrlSource

Constants§

LOCAL_BLOCK_SIZE
Recommended block size for the cache in front of a local file.
MAX_BLOCKS
Recommended cache capacity, in blocks.
URL_BLOCK_SIZE
Recommended block size for the cache in front of a URL: a range request has a fixed cost worth amortising over more bytes.

Traits§

ByteSink
ByteSource
A random-access source of bytes.

Functions§

http_get_text
A plain GET returning the body as text.
is_gzipped
The 0x1F 0x8B magic.
is_url
True for a path a UrlSource handles.
open
Open path as a local file or a URL, wrapped in a block cache.
open_text
Open a path for sequential reading, inflating when it is gzipped.

Type Aliases§

GzipReader
MultiGzDecoder, never GzDecoder: concatenated members are what a gzip file is here — BGZF is nothing else, and bgzip writes one member per block — and only the multi variant walks past the first.
TextInput
Sequential reads over anything, buffered. Named so the converters do not spell the generic out.