pub struct Manifest {
pub id: String,
pub version: String,
pub schema_version: Version,
pub interface_version: Version,
pub network_hosts: Vec<String>,
}Expand description
A parsed plugin manifest.
§Examples
use fulltime_plugin_api::Manifest;
let toml = r#"
id = "bundesliga"
version = "0.1.0"
schema_version = "1.0"
interface_version = "1.0"
network_hosts = ["api.openligadb.de"]
"#;
let manifest = Manifest::parse(toml).unwrap();
assert_eq!(manifest.id, "bundesliga");
assert_eq!(manifest.network_hosts, ["api.openligadb.de"]);Fields§
§id: StringPlugin identifier, unique among plugins the host loads.
version: StringPlugin’s own release version (not a contract version).
schema_version: VersionCanonical schema version this plugin’s output targets.
interface_version: VersionData-provider interface version this plugin was built against.
network_hosts: Vec<String>Network hosts this plugin requires access to.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn parse(source: &str) -> Result<Self, ManifestError>
pub fn parse(source: &str) -> Result<Self, ManifestError>
Parses and validates a manifest from its TOML source.
§Errors
Returns ManifestError::Malformed if source is not valid TOML, or
ManifestError::InvalidField if a required field is missing or a version field
is not a valid "major.minor" string. No network host in network_hosts is
contacted or otherwise validated beyond being a non-empty string.
§Examples
use fulltime_plugin_api::{Manifest, ManifestError};
let err = Manifest::parse("id = \"x\"").unwrap_err();
assert!(matches!(err, ManifestError::InvalidField { .. }));Trait Implementations§
impl Eq for Manifest
impl StructuralPartialEq for Manifest
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnsafeUnpin for Manifest
impl UnwindSafe for Manifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more