pub trait Source {
type Error: Error + Send + Sync + 'static;
// Required methods
fn description(&self) -> Description;
fn read_rows(
&mut self,
first: u32,
rows: PixelSliceMut<'_>,
pulse: Option<&dyn Pulse>,
) -> Result<(), Self::Error>;
// Provided methods
fn mechanism(&self) -> OutputSource { ... }
fn borrowed_pixels(&self) -> Option<PixelSlice<'_>> { ... }
fn supports_positional_replay(&self) -> bool { ... }
fn replay_identity(&self) -> Result<Option<[u64; 4]>, Self::Error> { ... }
}Expand description
A fixed-interpretation source, retained across policy and read on demand.
Required Associated Types§
Required Methods§
Sourcefn description(&self) -> Description
fn description(&self) -> Description
Fixed declaration. Changing it during read fails before the next encode.
Sourcefn read_rows(
&mut self,
first: u32,
rows: PixelSliceMut<'_>,
pulse: Option<&dyn Pulse>,
) -> Result<(), Self::Error>
fn read_rows( &mut self, first: u32, rows: PixelSliceMut<'_>, pulse: Option<&dyn Pulse>, ) -> Result<(), Self::Error>
Fill every active sample of the requested consecutive rows, honoring
destination stride. No reading beyond the declared image is requested.
A late interpretation change must fail, never relabel earlier samples.
None adds no per-call control; any control retained by the source
remains active.
Provided Methods§
Sourcefn mechanism(&self) -> OutputSource
fn mechanism(&self) -> OutputSource
Acquisition mechanism, not a retained-memory guarantee.
Sourcefn borrowed_pixels(&self) -> Option<PixelSlice<'_>>
fn borrowed_pixels(&self) -> Option<PixelSlice<'_>>
Return a real immutable raster view retained for the entire operation.
The default supplies no borrow. The driver uses this returned storage,
never mechanism() or a capability flag, as exact replay evidence.
Sourcefn supports_positional_replay(&self) -> bool
fn supports_positional_replay(&self) -> bool
Whether ordered traversals can restart at row zero without reconstructing this source. Defaults to forward-only. This proves no sample identity; positional replay is checked with per-row digests and optional identity.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".