[−][src]Struct auditable_serde::VersionInfo
Dependency tree embedded in the binary.
Implements Serialize
and Deserialize
traits from serde
, so you can use
all the usual methods from serde-json
to read and write it.
from_str()
that parses JSON is also implemented for your convenience:
use auditable_serde::VersionInfo; use std::str::FromStr; let json_str = r#"{"packages":[{ "name":"adler", "version":"0.2.3", "source":"registry" }]}"#; let info = VersionInfo::from_str(json_str).unwrap(); assert_eq!(&info.packages[0].name, "adler");
Optional features
If the from_metadata
feature is enabled, a conversion from
cargo_metadata::Metadata
is possible via the TryFrom
trait. This is the preferred way to construct this structure.
An example demonstrating that can be found
here.
If the toml
feature is enabled, a conversion into the cargo_lock::Lockfile
struct is possible via the TryFrom
trait. This can be useful if you need to interoperate with tooling
that consumes the Cargo.lock
file format. An example demonstrating it can be found
here.
Fields
packages: Vec<Package>
Trait Implementations
impl Clone for VersionInfo
[src]
fn clone(&self) -> VersionInfo
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for VersionInfo
[src]
impl<'de> Deserialize<'de> for VersionInfo
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for VersionInfo
[src]
impl FromStr for VersionInfo
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Ord for VersionInfo
[src]
fn cmp(&self, other: &VersionInfo) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<VersionInfo> for VersionInfo
[src]
fn eq(&self, other: &VersionInfo) -> bool
[src]
fn ne(&self, other: &VersionInfo) -> bool
[src]
impl PartialOrd<VersionInfo> for VersionInfo
[src]
fn partial_cmp(&self, other: &VersionInfo) -> Option<Ordering>
[src]
fn lt(&self, other: &VersionInfo) -> bool
[src]
fn le(&self, other: &VersionInfo) -> bool
[src]
fn gt(&self, other: &VersionInfo) -> bool
[src]
fn ge(&self, other: &VersionInfo) -> bool
[src]
impl Serialize for VersionInfo
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for VersionInfo
[src]
impl StructuralPartialEq for VersionInfo
[src]
impl<'_> TryFrom<&'_ Metadata> for VersionInfo
[src]
type Error = InsufficientMetadata
The type returned in the event of a conversion error.
fn try_from(metadata: &Metadata) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ VersionInfo> for Lockfile
[src]
Auto Trait Implementations
impl RefUnwindSafe for VersionInfo
impl Send for VersionInfo
impl Sync for VersionInfo
impl Unpin for VersionInfo
impl UnwindSafe for VersionInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,