MCPcopy Create free account
hub / github.com/archlinux/alpm / from_str

Method from_str

alpm-srcinfo/src/schema.rs:147–152  ·  view source on GitHub ↗

Creates a [`SourceInfoSchema`] from string slice `s`. Relies on [`SchemaVersion::from_str`] to create a corresponding [`SourceInfoSchema`] from `s`. # Errors Returns an error if - no [`SchemaVersion`] can be created from `s`, - or the conversion from [`SchemaVersion`] to [`SourceInfoSchema`] fails.

(s: &str)

Source from the content-addressed store, hash-verified

145 /// - or the conversion from [`SchemaVersion`] to [`SourceInfoSchema`] fails.
146 fn from_str(s: &str) -> Result<SourceInfoSchema, Self::Err> {
147 match SchemaVersion::from_str(s) {
148 Ok(version) => Self::try_from(version),
149 Err(_) => Err(Error::UnsupportedSchemaVersion(s.to_string())),
150 }
151 }
152}
153
154impl TryFrom<SchemaVersion> for SourceInfoSchema {
155 type Error = Error;

Callers

nothing calls this directly

Calls 1

from_strFunction · 0.85

Tested by

no test coverage detected