pub trait DataSource: Debug {
    fn type_id(&self) -> &str;
    fn request_data(&self, args: Vec<RantValue>) -> DataSourceResult<RantValue>;
}
Expand description

Trait for defining a Rant data source type.

Security

This trait can potentially be used to grant Rant access to network, filesystem, or other sensitive resources. Please take care to ensure that such access is adequately sandboxed, has granular permissions, and that failed access to such resources is handled gracefully.

Required Methods

Returns a string identifying the type of data source this is; ideally, this should be something short and human-readable. Refer to implementor documentation for the specific string returned.

Security

Because implementors can make this method return any string at all, usage should be limited to diagnostic and filtering purposes only.

Requests some data from the data source.

This method is called by Rant’s [data] funtion to interact with data sources.

Implementors