Skip to main content

Source

Trait Source 

Source
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§

Source

type Error: Error + Send + Sync + 'static

Original source error; retained in the operation’s error chain.

Required Methods§

Source

fn description(&self) -> Description

Fixed declaration. Changing it during read fails before the next encode.

Source

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§

Source

fn mechanism(&self) -> OutputSource

Acquisition mechanism, not a retained-memory guarantee.

Source

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.

Source

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.

Source

fn replay_identity(&self) -> Result<Option<[u64; 4]>, Self::Error>

Optional opaque identity/version of this retained source. A stable value is weaker than sample-exact replay. The driver also checks row digests.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§