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§
Sourcefn canonicalize(&self, path: &Path) -> Result<PathBuf, SchemaSourceServiceError>
fn canonicalize(&self, path: &Path) -> Result<PathBuf, SchemaSourceServiceError>
Resolves one path to its canonical physical path.
Sourcefn metadata(
&self,
path: &Path,
) -> Result<SchemaSourceObservation, SchemaSourceServiceError>
fn metadata( &self, path: &Path, ) -> Result<SchemaSourceObservation, SchemaSourceServiceError>
Observes one path while following symbolic links.
Sourcefn symlink_metadata(
&self,
path: &Path,
) -> Result<SchemaSourceObservation, SchemaSourceServiceError>
fn symlink_metadata( &self, path: &Path, ) -> Result<SchemaSourceObservation, SchemaSourceServiceError>
Observes one path without following its final symbolic link.
Sourcefn read_directory_names(
&self,
path: &Path,
) -> Result<Vec<OsString>, SchemaSourceServiceError>
fn read_directory_names( &self, path: &Path, ) -> Result<Vec<OsString>, SchemaSourceServiceError>
Returns direct entry names in ascending platform byte order.
Sourcefn capture_file(
&self,
path: &Path,
maximum_bytes: usize,
) -> Result<SchemaSourceCapture, SchemaSourceServiceError>
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".