pub struct Soname {
pub name: SharedObjectName,
pub version: Option<PackageVersion>,
}
Expand description
The value of a shared object’s soname.
This data may be present in the SONAME or NEEDED fields of a shared object’s dynamic section.
The soname data may contain only a shared object name (e.g. libexample.so
) or a shared
object name, that also encodes version information (e.g. libexample.so.1
).
Fields§
§name: SharedObjectName
The name part of a shared object’s soname.
version: Option<PackageVersion>
The optional version part of a shared object’s soname.
Implementations§
Source§impl Soname
impl Soname
Sourcepub fn new(name: SharedObjectName, version: Option<PackageVersion>) -> Self
pub fn new(name: SharedObjectName, version: Option<PackageVersion>) -> Self
Creates a new Soname
.
Sourcepub fn parser(input: &mut &str) -> ModalResult<Self>
pub fn parser(input: &mut &str) -> ModalResult<Self>
Recognizes a Soname
in a string slice.
The passed data can be in the following formats:
<name>.so
: A shared object name without a version. (e.g.libexample.so
)<name>.so.<version>
: A shared object name with a version. (e.g.libexample.so.1
)- The version must be a valid
PackageVersion
.
- The version must be a valid
Trait Implementations§
Source§impl FromStr for Soname
impl FromStr for Soname
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Recognizes a Soname
in a string slice.
The string slice must be in the format of <name>.so
or <name>.so.<version>
.
§Errors
Returns an error if a Soname
can not be parsed from input.
§Examples
use std::str::FromStr;
use alpm_types::Soname;
assert_eq!(
Soname::from_str("libexample.so.1")?,
Soname::new("libexample.so".parse()?, Some("1".parse()?)),
);
assert_eq!(
Soname::from_str("libexample.so")?,
Soname::new("libexample.so".parse()?, None),
);
impl Eq for Soname
impl StructuralPartialEq for Soname
Auto Trait Implementations§
impl Freeze for Soname
impl RefUnwindSafe for Soname
impl Send for Soname
impl Sync for Soname
impl Unpin for Soname
impl UnwindSafe for Soname
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