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§
- Cached
Source - Local
Sink - A local file opened for both directions, so the zoom pass reads back through the handle that wrote.
- Local
Source - Retry
Policy - Sink
Source - 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§
- Byte
Sink - Byte
Source - 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
UrlSourcehandles. - open
- Open
pathas 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§
- Gzip
Reader MultiGzDecoder, neverGzDecoder: concatenated members are what a gzip file is here — BGZF is nothing else, andbgzipwrites one member per block — and only the multi variant walks past the first.- Text
Input - Sequential reads over anything, buffered. Named so the converters do not spell the generic out.