pub trait Source {
type Raw: DeserializeOwned;
type Error: Error + Send + Sync + 'static;
// Required methods
fn id(&self) -> SourceId;
fn endpoint(&self) -> &Url;
fn parse(&self, raw: &str) -> Result<Self::Raw, Self::Error>;
fn to_evidence(
&self,
raw: Self::Raw,
model: &ModelId,
) -> Result<Vec<Evidence>, Self::Error>;
}Expand description
The Source trait: each upstream source implements this.
Sources are pure: they parse and convert without performing I/O. This allows adapters to be tested against frozen fixtures without network access.
Required Associated Types§
Sourcetype Raw: DeserializeOwned
type Raw: DeserializeOwned
The native schema for this source’s upstream data.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".