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

Method try_from

python-alpm/src/srcinfo/schema.rs:61–69  ·  view source on GitHub ↗
(value: SchemaVersionOrStr)

Source from the content-addressed store, hash-verified

59 type Error = crate::types::Error;
60
61 fn try_from(value: SchemaVersionOrStr) -> Result<Self, Self::Error> {
62 match value {
63 SchemaVersionOrStr::SchemaVersion(v) => Ok(v.into()),
64 SchemaVersionOrStr::Str(s) => {
65 let v = alpm_types::SchemaVersion::from_str(&s)?;
66 Ok(v)
67 }
68 }
69 }
70}
71
72#[pymodule(gil_used = false, name = "schema", submodule)]

Callers

nothing calls this directly

Calls 1

from_strFunction · 0.85

Tested by

no test coverage detected