pub trait TextSource:
Debug
+ Send
+ Sync {
// Required methods
fn len(&self) -> usize;
fn bytes_at(&self, index: usize) -> Result<Option<&[u8]>>;
fn footprint(&self) -> usize;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn bytes_len_at(&self, index: usize) -> Result<Option<usize>> { ... }
fn equal(&self, other: &dyn TextSource) -> bool { ... }
}Expand description
Random access to immutable text kept by a storage reader.
Required Methods§
Provided Methods§
Sourcefn bytes_len_at(&self, index: usize) -> Result<Option<usize>>
fn bytes_len_at(&self, index: usize) -> Result<Option<usize>>
Byte length at one position without requiring the payload when the source has an index.
Sourcefn equal(&self, other: &dyn TextSource) -> bool
fn equal(&self, other: &dyn TextSource) -> bool
Whether another source presents the same values.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".