Skip to main content

SchemaSourceService

Trait SchemaSourceService 

Source
pub trait SchemaSourceService {
    // Required methods
    fn canonicalize(
        &self,
        path: &Path,
    ) -> Result<PathBuf, SchemaSourceServiceError>;
    fn metadata(
        &self,
        path: &Path,
    ) -> Result<SchemaSourceObservation, SchemaSourceServiceError>;
    fn symlink_metadata(
        &self,
        path: &Path,
    ) -> Result<SchemaSourceObservation, SchemaSourceServiceError>;
    fn read_directory_names(
        &self,
        path: &Path,
    ) -> Result<Vec<OsString>, SchemaSourceServiceError>;
    fn capture_file(
        &self,
        path: &Path,
        maximum_bytes: usize,
    ) -> Result<SchemaSourceCapture, SchemaSourceServiceError>;
}
Expand description

Bounded environmental observations used by deterministic schema discovery.

Implementations supply raw observations only. The shared loader retains confinement, matching, alias/collision rejection, reselection, parsing, and evidence construction.

Required Methods§

Source

fn canonicalize(&self, path: &Path) -> Result<PathBuf, SchemaSourceServiceError>

Resolves one path to its canonical physical path.

Source

fn metadata( &self, path: &Path, ) -> Result<SchemaSourceObservation, SchemaSourceServiceError>

Observes one path while following symbolic links.

Observes one path without following its final symbolic link.

Source

fn read_directory_names( &self, path: &Path, ) -> Result<Vec<OsString>, SchemaSourceServiceError>

Returns direct entry names in ascending platform byte order.

Source

fn capture_file( &self, path: &Path, maximum_bytes: usize, ) -> Result<SchemaSourceCapture, SchemaSourceServiceError>

Captures at most maximum_bytes + 1 bytes with before/after observations.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§