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

Method parse

alpm-types/src/version/comparison.rs:125–131  ·  view source on GitHub ↗

Creates a type `T` from the inner string slice by relying on `T`'s [`FromStr::from_str`] implementation.

(&self)

Source from the content-addressed store, hash-verified

123 /// Creates a type `T` from the inner string slice by relying on `T`'s [`FromStr::from_str`]
124 /// implementation.
125 pub fn parse<T: FromStr>(&self) -> Result<T, T::Err> {
126 match self {
127 VersionSegment::Segment { text, .. } | VersionSegment::SubSegment { text } => {
128 FromStr::from_str(text)
129 }
130 }
131 }
132
133 /// Compares the inner string slice with that of another [`VersionSegment`].
134 pub fn str_cmp(&self, other: &VersionSegment) -> Ordering {

Callers 15

package_newFunction · 0.80
package_new_failsFunction · 0.80
from_strMethod · 0.80
from_strMethod · 0.80
from_strMethod · 0.80
parse_mtree_v2Function · 0.80
ensure_errors_v1Function · 0.80
derive_from_strMethod · 0.80
from_stringMethod · 0.80
try_fromMethod · 0.80
parse_valueFunction · 0.80

Calls 1

from_strFunction · 0.85

Tested by 10

package_newFunction · 0.64
package_new_failsFunction · 0.64
ensure_errors_v1Function · 0.64
mainFunction · 0.64
write_iniFunction · 0.64
package_file_name_nameFunction · 0.64